[FE training-materials-updates] labs/autotools-basics: play a bit more with Git

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu May 21 17:04:51 CEST 2015


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=2b3763c4fa8eda94bff40d3fcb769fb0e5568321

>---------------------------------------------------------------

commit 2b3763c4fa8eda94bff40d3fcb769fb0e5568321
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Thu May 21 17:04:15 2015 +0200

    labs/autotools-basics: play a bit more with Git
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


>---------------------------------------------------------------

2b3763c4fa8eda94bff40d3fcb769fb0e5568321
 labs/autotools-basics/autotools-basics.tex | 41 ++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/labs/autotools-basics/autotools-basics.tex b/labs/autotools-basics/autotools-basics.tex
index 204df16..98494dd 100644
--- a/labs/autotools-basics/autotools-basics.tex
+++ b/labs/autotools-basics/autotools-basics.tex
@@ -69,3 +69,44 @@ compare it to your \code{configure.ac}. What are the differences?
 
 Run \code{make dist}, and look at the tarball that is generated. Your
 project is ready to be released!
+
+Now, run \code{git add} on \code{configure.ac}, \code{Makefile.am} and
+\code{hello.c}, and do a new commit: \code{git commit -s -m ``Add a
+  real program''}. If you run \code{git status}, you can see that
+there are really a lot of files generated by {\em autotols}, so add a
+\code{.gitignore} file to tell Git to simply ignore them. This file
+should contain something like:
+
+\begin{verbatim}
+.deps/
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache/
+compile
+config.log
+config.status
+configure
+depcomp
+hello
+hello.o
+install-sh
+missing
+\end{verbatim}
+
+The files \code{configure.scan} and \code{autoscan.log} can simply be
+removed, they would only get re-created if we run \code{autoscan}
+again.
+
+Commit your \code{.gitignore} file
+
+\begin{verbatim}
+git add .gitignore
+git commit -s -m ``Add gitignore file''
+\end{verbatim}
+
+Now at any time you can do \code{git clean -xdf} to ask Git to remove
+all the files that are not under version control. This allows to
+easily get rid of all the files generated by the {\em autotools} and
+see more clearly what's part of your project.
+



More information about the training-materials-updates mailing list