Get a local copy of a repository: ( Github Help )

git clone

Converting bzr to git

If you’ve got a bzr repo and you want to convert it to git:

cd bzrdir
git init
bzr fast-export –plain . | git fast-import
git co -f master
rm -rf .bzr/

NOTE: You’ll need something like the bzr-fastimport or python-fastimport package in Linux to get the fast-import plugin for bzr

If the packages don’t provide bzr fast-export then install the plugin manually:

cd ~/.bazaar/plugins
bzr branch lp:bzr-fastimport fastimport

Original source of those commands is


Syncing with a project you’ve forked so that you can prep a pull-request when things have changed in the original repo ( Github Help ):

Add an upstream remote:

git remote add upstream

Fetch and merge the repo:

git fetch upstream
git checkout master
git merge upstream/master


Commit and push the changes to your repo:

git commit
git push


In order create a patchset, first create a tag to work from

git tag start-work

Make commits and do work, then create a set of patches:

git format-patch --numbered start-work


Latest tag in the current branch: git describe --tags

Display the current branch: git rev-parse --abbrev-ref HEAD

Leave a Reply