Git

Cloning

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

git clone https://github.com/BrianSidebotham/kicad-doc

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 https://design.canonical.com/2015/01/converting-projects-between-git-and-bazaar/

Syncing

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 https://github.com/ciamplix/kicad-doc

Fetch and merge the repo:

git fetch upstream
git checkout master
git merge upstream/master

Committing

Commit and push the changes to your repo:

git commit
git push

Patchsets

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

Snippets

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

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

Leave a Reply