Hemanth Gundu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Git Commands - Task ## git init This command is used to create an empty git repository or to initialize and existing repository. git init ## git add This command is used to add the files or folders into the staging area. **To add a file to staging area:** git add <filename> **To add all files or folders in the currect directory** git add . ## git status This command is used to view the status of the repository and the files or folders that are present in the staging area. This show the list of files that are tracked and untracked. git status **To just view the list of files that are changed** git status --short ## git config This command is used to configure the username and email of the person working on the local repository. **To configure username** git config --global user.name = <name> **To configure email** git config --global user.email = <email> ## git commit This command is used to commit the changes that are made. Commit will fetch the changes available in the staging area. Commit command will create a snapshot of the repository. Each and every commit will have a commit message and a commit-id. Commit message is given by the user and commit-id is generate using SHA algorithm. git commit -m <commit-message> **To add and commit at once** git commit -a ## git log This command is used to get the total history of the repository. It provides the list of all the commits and for each commit it provides the username, date of commit, commit title and commit-hash. git log **To get each commit details in oneline** git log --oneline **To get the list of files modified and no. of lines modified in each commit** git log --stat **To get the list of files modified and also the location of the lines removed of added in the file** git log --patch **To get the graph of the commits made** Each node of graph represents a commit git log --graph ------------------------- git log --graph --oneline **To view last 'n' (n is a number) commit details** git log -n ## git diff This command is used to view the difference between the files in the one commit and another commit. **To view the changed before adding files to staging area** git diff **To view the change between two different commits** git diff <commit1-hashkey> <commit2-hashkey> **To view the change between two different branches** git diff <branch1-name> <branch2-name> ## git branch This command is used for creating a new branch. In git branch are used for independent development of any particular feature. The default branch in git is master branch. Any number of branches can be made from master branch or any other branch. **To create a new branch** git branch <branch-name> **To list the existing branch names** git branch **To delete a local branch** The branch gets deleted only if it is merged: git branch -d <branch-name> The branch gets deleted even if it not merged: git branch -D <branch-name> **To restore the deleted branch** git checkout -b <branch_name> <hashkey> ## git checkout This command is used to switch from one branch to another branch. git checkout <branch-name> ## git merge This command is used to merge the another branch with the current branch. The code present in the current branch and merged branch will be merged. git merge <branch-name> ## git clone This command is used to download the remote repository to the local system. git clone <remote-repo-url> **To clone a specific branch from the remote repo** git clone -b <branch-name> <remote-repo-url> ## git remote This command is used add the URLs of the remote repositories. git remote add <remote-url-name> <url of remote repo> Ex: git remote add origin https://github.com/Hemanthghs/gRPC-Protobuf-with-Golang.git ## git push This command is used to push a specific branch from the local repository to the remote repository **To push the local changes to remote repo** git push <remote-url-name> <branch-name> Ex: git push origin main **To list the remote URLs** git remote -v **To edit the existing remote url** git remote set-url <remote-url-name> <new url> ## git fetch This command will download the changes from the remote repository to the local repository. This will get the updates that are made to the remote repository into the local repository. This will only download the change and does not merge the changes. **To fetch a remote repo** git fetch <remote-url> **To fetch a specific remote branch** git fetch <remote-url> <branch-name> **To fetch all branches** git fetch -all ## git pull This command is combination of git fetch and git merge commands. git pull = git fetch + git merge This command will download the changes from the remote repository to the local repo and will merge the change with the local branch. There is a chances for merge conflicts. git pull ## git stash This command is used to switch the branch without making a commit. **To add stash the changes** git stash **To get back the changes** git stash apply **To remove all the stashes ** git stash clear **To remove most recent stash** git stash drop ## git revert This command is used to undo the changes made by a particular commit. Revert will undo the changes but it will not delete the changes from the repo, instead it will create a new commit for the each revert operation. git revert <commit-id> ## git reset This command is used to undo the changes. This will reset the current state of the HEAD to any specific state. git reset <commit id> ## git rm This is used to delete a file or files from the repository. git rm <file-name> The changes made by rm command are not permanent they can be reverted back. **To revert the rm command** git reset --hard ## git rm --cached This command is used to delete the file form git, but to preserve the file in the local system git rm --cached ## git rebase This command is used to change the base of the branch from https://hackmd.io/InPw2IiCTI-CYTubzJx7VQ?both#one commit to another commit. All the changes that are made in the base branch will be reflected in the current branch. git rebase <base-branch-name> ## git squash Squash is the technique that is used to group the multiple commits into a single commit. **To group last 5 commits into single commit** git rebase -i HEAD~5 Next in the interactive editor change the **pick** keyword to **squash** and save it. In the next editor write a single commit message. ## git tag This command is used to tag a commit and tag can be refered in future. A branch can have any number of tags. Tags can be names of the versions. **To create a tag** git tag <tag-name> **To list the tag names** git tag **To view the the repository at a particular tag** git show <tag-name> **To push a specific tag to remote repo** git push origin <tag-name>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully