Jump to content

User:SamanthaNguyen/git

From mediawiki.org

Tips and tricks on using Git.

Do a complete, hard reset

[edit]
$ git reset --hard origin/master && git checkout master && git pull

How to push to a branch other than master

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

How to rebase

[edit]
# 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 topic

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