Last active
December 16, 2015 17:19
-
-
Save odinecse/5469402 to your computer and use it in GitHub Desktop.
Cool Git Shortcuts
This file contains hidden or 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
# this deletes all files that were deleted in a repo and that are tracked in git | |
git rm $(git ls-files --deleted) | |
# check out a new branch to track remote | |
git checkout -b branch_name origin/branch_name | |
# delete local branch with unmerged warning | |
git branch -d branch_name | |
# delete local branch without unmerged warning | |
git branch -D branch_name | |
#delete branch on remote | |
git push origin :branch_name | |
# checkout a single file from a previous commit | |
git checkout commit_hash path/file.name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment