Skip to content

Instantly share code, notes, and snippets.

@Aravinth-Earth
Last active July 27, 2022 13:46
Show Gist options
  • Save Aravinth-Earth/c68999edad0d163ce00c14ac85271d3b to your computer and use it in GitHub Desktop.
Save Aravinth-Earth/c68999edad0d163ce00c14ac85271d3b to your computer and use it in GitHub Desktop.
A collection of git bash commands, that i have learned more usefull
## Create
git pull --> Get the latest code from the remote
git push --> Only when the local brach also exists in remote, push the local code changes
git push --set-upstream origin <#BranchName#> --> Set the remote tracking branch as per the name provided & push the local code changes
## Modify
git merge <#BranchName#> --> Merge the branch name mentioned to the current branch
git checkout -b <#BranchName#> --> Checkout to the branch name mentioned
git add . --> Stage all the changes to the
git commit -m <#Message#> --> Commit the staged changes with the message mentioned
git --amend <#Author#> --> In the last commit & update the author to the given value
git rm -r --cached <filename> --> Untrack a file from git versioning
## Retrive/See
git branch --> See all the local branches
git diff --> See the file changes in depth ( line by line )
git status --> Show the files which are modified
## Delete
git branch -d <#BranchName#> --> Delete the local branch name mentioned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment