Delete stuff
hg uncommit
/hg strip
git reset --hard HEAD~1
Combine stuff
hg combine xx (from xx to yy)
git reset --soft HEAD~3
git commit
orgit rebase -i head~3
Rewrite history
git rebase -i HEAD~11
Move branch pointer
git branch -f branch-name new-tip-commit
Fetching stuff
hg pull
git fetch
hg pull + rebase
git pull
Fetch from upstream
(first time only)
git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master
(when no changes on origin)
git push origin master --force
(when changes on origin)
git merge upstream/master
Deleting a branch locally and pushing delete up
git push origin --delete <branch>
git branch --delete <branch>
Deleting a local remote-tracking branch:
git fetch origin --prune
Merging PR on branch addMapToProjector
onto new branch feature/foo
from user janus
project stateprinter
git checkout -b feature/foo master
git pull https://github.com/janus/stateprinter.git addMapToProjector
git push -u "origin" refs/heads/feature/foo:refs/heads/feature/foo
function unco()
{
"git reset --soft head~1"
git reset --soft head~1
}
function bundle($path)
{
"git format-patch origin/master --stdout > c:\bundle\$path.diff"
git format-patch origin/master --stdout > c:\bundle\$path.diff
}