Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 60

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Git Usage</TITLE>
<META NAME="description" CONTENT="Git Usage">
<META NAME="keywords" CONTENT="developers">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="developers.css">

<LINK REL="next" HREF="Step_Step_Modifying_Bacula.html">
<LINK REL="previous" HREF="Bacula_Git_repositories.html">
<LINK REL="up" HREF="Bacula_Git_Usage.html">
<LINK REL="next" HREF="Step_Step_Modifying_Bacula.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html574"
  HREF="Step_Step_Modifying_Bacula.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html568"
  HREF="Bacula_Git_Usage.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html562"
  HREF="Bacula_Git_repositories.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html570"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html572"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html575"
  HREF="Step_Step_Modifying_Bacula.html">Step by Step Modifying</A>
<B> Up:</B> <A NAME="tex2html569"
  HREF="Bacula_Git_Usage.html">Bacula Git Usage</A>
<B> Previous:</B> <A NAME="tex2html563"
  HREF="Bacula_Git_repositories.html">Bacula Git repositories</A>
 &nbsp; <B>  <A NAME="tex2html571"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html573"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html576"
  HREF="Git_Usage.html#SECTION00321000000000000000">Learning Git</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00320000000000000000"></A>
<A NAME="963"></A>
<BR>
Git Usage
</H1>

<P>
Please note that if you are familiar with SVN, Git is similar,
(and better), but there can be a few surprising differences that
can be very confusing (nothing worse than converting from CVS to SVN).

<P>
The main Bacula Git repo contains the subdirectories <B>bacula</B>, <B>gui</B>,
and <B>regress</B>. With Git it is not possible to pull only a
single directory, because of the hash code nature of Git, you
must take all or nothing.

<P>
For developers, the most important thing to remember about Git and
the Source Forge repository is not to "force" a <B>push</B> to the
repository. Doing so, can possibly rewrite
the Git repository history and cause a lot of problems for the 
project.

<P>
You can get a full copy of the Source Forge Bacula Git repository with the
following command:

<P>
<PRE>
git clone git://bacula.git.sourceforge.net/gitroot/bacula/bacula trunk
</PRE>

<P>
This will put a read-only copy into the directory <B>trunk</B> 
in your current directory, and <B>trunk</B> will contain
the subdirectories: <B>bacula</B>, <B>gui</B>, and <B>regress</B>.
Obviously you can use any name an not just <B>trunk</B>.  In fact,
once you have the repository in say <B>trunk</B>, you can copy the
whole directory to another place and have a fully functional
git repository.

<P>
If you have write permission to the Source Forge
repository, you can get a copy of the Git repo with:

<P>
<PRE>
git clone ssh://&lt;userid&gt;@bacula.git.sourceforge.net/gitroot/bacula/bacula trunk
</PRE>

<P>
where you replace <code>&lt;userid&gt;</code> with your Source Forge login 
userid, and you must have previously uploaded your public ssh key
to Source Forge.

<P>
The above command needs to be done only once. Thereafter, you can:

<P>
<PRE>
cd trunk
git pull     # refresh my repo with the latest code
</PRE>

<P>
As of August 2009, the size of the repository (<B>trunk</B> in the above
example) will be approximately 55 Megabytes.  However, if you build
from source in this directory and do a lot of updates and regression
testing, the directory could become several hundred megabytes.

<P>

<H2><A NAME="SECTION00321000000000000000"></A>
<A NAME="986"></A>
<BR>
Learning Git
</H2>
If you want to learn more about Git, we recommend that you visit:
<BR>
http://book.git-scm.com/http://book.git-scm.com/.

<P>
Some of the differences between Git and SVN are:

<UL>
<LI>Your main Git directory is a full Git repository to which you can
  and must commit. In fact, we suggest you commit frequently.
</LI>
<LI>When you commit, the commit goes into your local Git
  database.  You must use another command to write it to the
  master Source Forge repository (see below).
</LI>
<LI>The local Git database is kept in the directory <B>.git</B> at the 
  top level of the directory.
</LI>
<LI>All the important Git configuration information is kept in the
  file <B>.git/config</B> in ASCII format that is easy to manually edit.
</LI>
<LI>When you do a <B>commit</B> the changes are put in <B>.git</B>
  rather but not in the main Source Forge repository.
</LI>
<LI>You can push your changes to the external repository using
  the command <B>git push</B> providing you have write permission
  on the repository.
</LI>
<LI>We restrict developers just learning git to have read-only
  access until they feel comfortable with git before giving them
  write access.
</LI>
<LI>You can download all the current changes in the external repository
  and merge them into your <B>master</B> branch using the command
  <B>git pull</B>.
</LI>
<LI>The command <B>git add</B> is used to add a new file to the
  repository AND to tell Git that you want a file that has changed
  to be in the next commit.  This has lots of advantages, because
  a <B>git commit</B> only commits those files that have been 
  explicitly added.  Note with SVN <B>add</B> is used only
  to add new files to the repo.
</LI>
<LI>You can add and commit all files modifed in one command
  using <B>git commit -a</B>.
</LI>
<LI>This extra use of <B>add</B> allows you to make a number
  of changes then add only a few of the files and commit them,
  then add more files and commit them until you have committed
  everything. This has the advantage of allowing you to more
  easily group small changes and do individaual commits on them.
  By keeping commits smaller, and separated into topics, it makes
  it much easier to later select certain commits for backporting.
</LI>
<LI>If you <B>git pull</B> from the main repository and make
  some changes, and before you do a <B>git push</B> someone
  else pushes changes to the Git repository, your changes will
  apply to an older version of the repository you will probably
  get an error message such as:

<P>
<PRE>
 git push
 To git@github.com:bacula/bacula.git
  ! [rejected]        master -&gt; master (non-fast forward)
  error: failed to push some refs to 'git@github.com:bacula/bacula.git'
</PRE>

<P>
which is Git's way of telling you that the main repository has changed
 and that if you push your changes, they will not be integrated properly.
 This is very similar to what happens when you do an "svn update" and
 get merge conflicts.
 As we have noted above, you should never ask Git to force the push.
 See below for an explanation of why.
</LI>
<LI>To integrate (merge) your changes properly, you should always do 
 a <B>git pull</B> just prior to doing a <B>git push</B>.
</LI>
<LI>If Git is unable to merge your changes or finds a conflict it
  will tell you and you must do conflict resolution, which is much
  easier in Git than in SVN.
</LI>
<LI>Resolving conflicts is described below in the <B>github</B> section.
</LI>
</UL>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html574"
  HREF="Step_Step_Modifying_Bacula.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html568"
  HREF="Bacula_Git_Usage.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html562"
  HREF="Bacula_Git_repositories.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html570"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html572"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html575"
  HREF="Step_Step_Modifying_Bacula.html">Step by Step Modifying</A>
<B> Up:</B> <A NAME="tex2html569"
  HREF="Bacula_Git_Usage.html">Bacula Git Usage</A>
<B> Previous:</B> <A NAME="tex2html563"
  HREF="Bacula_Git_repositories.html">Bacula Git repositories</A>
 &nbsp; <B>  <A NAME="tex2html571"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html573"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>