import of olds chapters

This commit is contained in:
2020-10-26 23:06:17 +01:00
parent 9a9d3108ba
commit d79a55fd2e
18 changed files with 600 additions and 18 deletions

View File

@@ -6,8 +6,10 @@ aux quatre coins des interwebs. Je ne vais donc pas m'étendre
plus que ça, pour passer tout de suite à un cas particulier
\footnote{que je n'arrive pas encore à vraiment maitriser}.
% --------------------------------------------------------------------
\section{Démarrage}
\subsection{En local}
\begin{verbatim}
$ mkdir Foo
$ cd Foo/
@@ -17,7 +19,7 @@ $ git add README.txt
\end{verbatim}
\section{Setup du serveur}
\subsection{Setup du serveur}
Sur le serveur distant, dans un endroit accessible par
le protocole \texttt{HTTP}, il faut créer le dépot.
@@ -33,16 +35,53 @@ Et ensuite :
$ git update-server-info
\end{verbatim}
\section{Pousser le code}
% --------------------------------------------------------------------
\subsection{Pousser le code}
Notre commit\index{commit} local semble pertinent,
il est temps de le faire connaitre au monde.
\begin{verbatim}
$ git push yuser@serveur:/chemin/vers/le/depot/Foo
\end{verbatim}
% --------------------------------------------------------------------
\section{Configuration dynamique}
\texttt{http://sandrotosi.blogspot.com/2020/10/multiple-git-configurations-depending.html}
One way to change the user.email git config value is to git config --local
in every repo, but that's tedious, error-prone and
doesn't scale very well with many repositories
(and the chances to forget to set the right one on a new repo are ~100\%).
The solution is to use the git-config ability to include
extra configuration files, based on the repo path, by using includeIf:
\vspace{1em}
Content of \texttt{\$HOME/.gitconfig} :
\begin{verbatim}
[user]
name = Sandro Tosi
email = <personal.address>@gmail.com
[includeIf "gitdir:~/deb/"]
path = ~/.gitconfig-deb
\end{verbatim}
Every time the git path is in ~/deb/ (which is where i have all Debian repos)
the file ~/.gitconfig-deb will be included; its content:
\begin{verbatim}
[user]
email = morph@debian.org
\end{verbatim}
That results in my personal address being used on all repos not part of Debian, where i use my Debian email address. This approach can be extended to every other git configuration values.
% --------------------------------------------------------------------
\section{Krkrkr...}
Tout cela semble bien compliqué.