-
-
Save nickarthur/40084207e41df1980cc00f90dd6da732 to your computer and use it in GitHub Desktop.
Git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removing a branch | |
Local : git branch -D <branch> | |
Remote : git push origin :<branch> | |
#--------------------------- | |
# Rename commit message | |
# ref: http://darrinholst.com/post/359817782 | |
git rebase -i <commit-hash> | |
#--------------------------- | |
# Rename branch | |
git branch -m <old_branch> <new_branch> | |
#--------------------------- | |
# Keeping a clean GitHub fork. | |
# Ref: http://blog.evan.pro/keeping-a-clean-github-fork-part-1 | |
git remote add upstream <git-url-project> | |
git fetch upstream | |
git merge --ff-only upstream/master | |
git pull --ff-only upstream master | |
git push origin master | |
git fetch --all | |
#--------------------------- | |
# Properly excluding IDE-specific files with Git | |
# Ref: http://blog.evan.pro/properly-excluding-ide-specific-files-with-git | |
git config --global core.excludesfile ~/.gitignore_global | |
#--------------------------- | |
# Rename a tag | |
git tag new_tag old_tag | |
git push --tags | |
git push origin :refs/tags/old_tag | |
git tag -d old_tag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment