Skip to content

Instantly share code, notes, and snippets.

@rizky
Last active March 1, 2017 16:26
Show Gist options
  • Save rizky/0dccf3e347196421326121ba579b0312 to your computer and use it in GitHub Desktop.
Save rizky/0dccf3e347196421326121ba579b0312 to your computer and use it in GitHub Desktop.
GIT Cheatsheet
#Add remote origin
git remote add origin $(github-address)
#Push to origin
git push -u origin master
#Create new branch
git checkout -b $(new-branch)
git push -u origin $(new-branch)
#Chechout branch
git fetch
git checkout origin/$(branch-name)
#Undu Pushed Commit
git reset --hard $(revision-id)
git push --force
#Setup Sync github
[remote "origin"]
url = $git-url
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment