$ git add ... # Stage a fix
$ git commit --fixup=a0b1c2d3 # Perform the commit to fix broken a0b1c2d3
$ git rebase -i --autosquash a0b1c2d3~1 # Now merge fixup commit into broken commit
git remote add origin [email protected]:user/repo-name.git
List your existing remotes in order to get the name of the remote you want to change.
$ git remote -v
origin [email protected]:user/repo-name.git (fetch)
origin [email protected]:user/repo-name.git (push)
Change your remote's URL
$ git remote set-url origin [email protected]:user/repo-name.git
Verify that the remote URL has changed with git remote -v (s. above).
# Switch to the local branch you want to rename
$ git checkout <oldname>
# Rename local branch
$ git branch -m <newname># Push the local branch with the new name and reset the upstream branch
$ git push origin -u <newname>
# Delete the remote branch with the old name
$ git push origin --delete <oldname>Sometimes you want to explicitly declare the remote's branch name. This might be the case when the remote's branch name is different then the local or when working with several remotes.
git push <remote-name> <local-branch-name>:<remote-branch-name>git fetch <remote-name> <local-branch-name>:<remote-branch-name>s. Git docs
$ git shortlog -s -n --all --no-merges
$ git tag --delete <tagname>
Push an empty reference to the remote tag name
$ git push origin <tagname>
Or delete the tag explicitly
$ git push --delete origin <tagname>
# Start bisect process
$ git bisect start
# Provide 'good' and 'bad' commit
$ git bisect bad HEAD
$ git bisect good 8341e03b
# Git will check out a commit in the given range.
# Check the app/code and tell Git the result
$ git bisect [good|bad]
# Stop the bisect process when you're done
$ git bisect resetCreate an authors file to map svn users (e.g. 'authors.txt')
user = User Name <[email protected]>
john = John Doe <[email protected]># Clone the repo
$ git svn clone --no-metadata -A ./authors.txt -t tags -b branches -T trunk file:///Users/username/my-svn-repo