From 6824105d78d10d846c7b82a4a0a665324b5a32e6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 16 Mar 2010 09:49:34 +0100 Subject: [PATCH] Update git doc --- docs/manuals/en/developers/git.tex | 61 +++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/docs/manuals/en/developers/git.tex b/docs/manuals/en/developers/git.tex index 6674441c..9cbeab79 100644 --- a/docs/manuals/en/developers/git.tex +++ b/docs/manuals/en/developers/git.tex @@ -165,6 +165,16 @@ a change, then submit your change to the Bacula developers. What would you do? \begin{itemize} +\item Tell git who you are:\\ +\begin{verbatim} +git config --global user.name "First-name Last-name" +git config --global user.email "email@address.com" +\end{verbatim} + +Where you put your real name and your email address. Since +this is global, you only need to do it once on any given +machine regardless of how many git repos you work with. + \item Download the Source code:\\ \begin{verbatim} git clone ssh://@bacula.git.sourceforge.net/gitroot/bacula/bacula trunk @@ -189,6 +199,20 @@ make test \end{verbatim} +Note: if you forget to create a working branch prior to making +changes, and you make them on master, this is no problem providing +that you create the working branch before your first commit. +So assuming that you have edited master instead of your bugfix +branch, you can simply: + +\begin{verbatim} +git checkout -b bugfix master +\end{verbatim} + +and a new bugfix branch will be created and checked out. +You can then proceed to committing to your bugfix branch as +described in the next step. + \item commit your work: \begin{verbatim} git commit -am "Short comment on what I did" @@ -239,17 +263,44 @@ git add (name-of-file-no-longer-in-conflict) git rebase --continue \end{verbatim} -\item When you are ready to send a patch, do the following:\\ +\item If you find that it is impossible to reconcile the two + branches or you made a mistake in correcting and adding files, +before you enter the: +\begin{verbatim} +git rebase --continue +\end{verbatim} +you can instead enter: + +\begin{verbatim} +git rebase --abort +\end{verbatim} + + which will essentially cancel the the original git rebase and reset + everything to the beginning with no changes to your bugfix branch. + +\item When you have completed the rebase and + are ready to send a patch, do the following:\\ \begin{verbatim} git checkout bugfix git format-patch -M master \end{verbatim} -Look at the files produced. They should be numbered 0001-xxx.patch -where there is one file for each commit you did, number sequentially, -and the xxx is what you put in the commit comment. + Look at the files produced. They should be numbered 0001-xxx.patch + where there is one file for each commit you did, number sequentially, + and the xxx is what you put in the commit comment. \item If the patch files are good, send them by email to the developers -as attachments. + as attachments. + +\item Then you can continue working on your code if you want, or + start another branch with a new project. + +\item If you continue working on your bugfix branch, you should + do a {\bf git rebase master} from time to time, and when + your changes are committed to the repo, you will be automatically + synchronized. So that the next {\bf git format-patch} will produce + only the changes you made since the last format-patch you sent + to the developers. + \end{itemize} -- 2.39.5