Using Git
Setup
- Set your name with git
git config --global user.name "Ivan Ivanov" git config --global user.email "[email protected]"
- Go to https://github.com/settings/ssh and add your private SSH key.
- Clone the repository
git clone [email protected]:MariaDB/server.git cd server
- Run
git branch
to check that you're working on MariaDB 10.1:
server $ git branch * 10.1
Commit comments
In git commit messages are normally formatted as
subject body more body ...
That is, the first line is considered a *subject*, much like email subject. Many git commands and pages on github only show the commit subject, not the complete comment. After the subject goes an empty line, then the detailed description of the comment. Please, structure your commit comments this way, don't forget the empty line.
Branches
This is an important concept, and git branches do not have equivalents in bzr.
In Bazaar, we all used to have one shared repository, within which there were many branches. This seems to be impossible with git?
In Git, each repository has only one branch that is currently checked out.
git branch
Note: branches whose names start with bb-
are automatically put into the buildbot.
Equivalents for some bzr commands
CAVEAT EMPTOR. Check the manual before running!
bzr status
isgit status
bzr diff
isgit diff
bzr log
isgit log
bzr revert
isgit reset --hard
bzr parent
isgit remote -v
(but there are more detailed commands)bzr push
isgit push REMOTENAME BRANCHNAME
. REMOTENAME is typically "origin", for example:git push origin 10.1-new-feature
bzr clean-tree --ignored
isgit clean -Xdf
(note the capital X!)bzr root
isgit rev-parse --show-toplevel
bzr missing --mine-only
isgit cherry -v origin
(kind-of).
GUIs
bzr gcommit
isgit citool
bzr viz
isgitk
bzr gannotate
isgit gui blame