Skip to content

Instantly share code, notes, and snippets.

@iozozturk
Last active November 8, 2016 08:21
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 iozozturk/67caa0a1cabf76813b77db8ac2e1308c to your computer and use it in GitHub Desktop.
Save iozozturk/67caa0a1cabf76813b77db8ac2e1308c to your computer and use it in GitHub Desktop.
Good set of git commands in help
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