Skip to content

Instantly share code, notes, and snippets.

@dsrini-open
Last active March 4, 2020 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsrini-open/2907aec302e8f9e763762e359f5dffa3 to your computer and use it in GitHub Desktop.
Save dsrini-open/2907aec302e8f9e763762e359f5dffa3 to your computer and use it in GitHub Desktop.
GIT useful commands
GIT merge:
git checkout master
git pull origin master
git merge <branch>
git push origin master
GIT delete branches:
Remote then local
git push -d origin <branch_name>
git branch -d <branch_name>
GIT merge master to branch:
git checkout test
git merge origin/master
(or)
git checkout test
git rebase master
GIT create branch:
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
GIT revert:
git checkout filename
git checkout -- filename
GIT Remove newly added gitignore files:
git commit (first do a commit)
git rm -r --cached .
git add .
git commit -m ".gitignore fix"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment