Last active
November 8, 2016 08:21
-
-
Save iozozturk/67caa0a1cabf76813b77db8ac2e1308c to your computer and use it in GitHub Desktop.
Good set of git commands in help
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
Quick Help | |
git reflog #time machine | |
git reset HEAD@{index} | |
# make your change | |
git add . # or add individual files | |
git commit --amend | |
# follow prompts to change or keep the commit message | |
# now your last commit contains that change! | |
#similar with above but w/ 4 commits | |
git rebase -i HEAD~4 #take 4 commits and “fixup” all but one to merge commits into 1 | |
git commit --amend #change commit message | |
# undo the last commit, but leave the changes available | |
git reset HEAD~ --soft | |
git remote -v #list remote | |
git remote add origin <URL> | |
git remote set-url origin <url> | |
git branch #list | |
git branch <name> #create | |
git rebase -i HEAD~4 #take 4 commits and “fixup” all but one to merge commits into 1 | |
git push origin --delete my-fix-branch #delete remote branch | |
git branch -D my-fix-branch #delete local branch | |
git pull --ff upstream master #like gpr | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment