User:SamanthaNguyen/git

Tips and tricks on using Git.

Do a complete, hard resetEdit

$ git reset --hard origin/master && git checkout master && git pull

How to push to a branch other than masterEdit

# Replace {branch-name} with what your branch is named, i.e "experimental"
$ git push origin HEAD:refs/for/{branch-name}

How to rebaseEdit

# download the patch (via git fetch or w/e)
$ git fetch {patch}
$ git rebase origin/master
# fix conflicts manually and git add the conflicted files
$ git add {files}
$ git rebase --continue
# push changes (you can also do git review)
$ git commit --amend
$ git push origin HEAD:refs/for/master

Set topicEdit

$ git push origin HEAD:refs/for/master/{git-topic-name}