maj index.html for french first

main
Grégory Lebreton 9 months ago
parent cdf099c7d5
commit 7d6c173576

@ -0,0 +1,231 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>git - the simple guide - no deep shit!</title>
<link href='http://fonts.googleapis.com/css?family=Chelsea+Market' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/0/normalize.min.css" type="text/css">
<link rel="stylesheet" href="css/style.css" type="text/css">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-652147-13']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
function recordOutboundLink(link, category, action) {
_gat._getTrackerByName()._trackEvent(category, action);
setTimeout('document.location = "' + link.href + '"', 100);
}
</script>
</head>
<body>
<div class="scrollblock block-title">
<h1>git - the simple guide</h1>
<p>just a simple guide for getting started with git. no deep shit ;)</p>
<p class="meta">
<a href="index.html">français</a>
<br />
</p>
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=gitguide" id="_carbonads_js"></script>
<img src="img/arrow.png" alt="" />
</div>
<!-- setup -->
<a name="setup"></a>
<div class="scrollblock block-setup">
<h2>setup</h2>
<p>
<a href="http://git-scm.com/download/mac">Download git for OSX</a>
</p>
<p>
<a href="http://msysgit.github.io/">Download git for Windows</a>
</p>
<p>
<a href="http://git-scm.com/book/en/Getting-Started-Installing-Git">Download git for Linux</a>
</p>
</div>
<a name="create"></a>
<div class="scrollblock block-create">
<h2>create a new repository</h2>
<p>
create a new directory, open it and perform a <br />
<code>git init</code><br />
to create a new git repository.
</p>
</div>
<a name="checkout"></a>
<div class="scrollblock block-checkout">
<h2>checkout a repository</h2>
<p>
create a working copy of a local repository by running the command<br />
<code>git clone /path/to/repository</code><br />
when using a remote server, your command will be<br />
<code>git clone username@host:/path/to/repository</code>
</p>
</div>
<a name="trees"></a>
<div class="scrollblock block-trees">
<h2>workflow</h2>
<p>
your local repository consists of three "trees" maintained by git.
the first one is your <code>Working Directory</code> which holds the actual files.
the second one is the <code>Index</code> which acts as a staging area and
finally the <code>HEAD</code> which points to the last commit you've made.
</p>
<img src="img/trees.png" alt="" />
</div>
<a name="add"></a>
<div class="scrollblock block-add">
<h2>add &amp; commit</h2>
<p>
You can propose changes (add it to the <b>Index</b>) using<br />
<code>git add &lt;filename&gt;</code><br />
<code>git add *</code><br />
This is the first step in the basic git workflow. To actually commit these changes use<br />
<code>git commit -m "Commit message"</code><br />
Now the file is committed to the <b>HEAD</b>, but not in your remote repository yet.
</p>
</div>
<a name="push"></a>
<div class="scrollblock block-remote">
<h2>pushing changes</h2>
<p>
Your changes are now in the <b>HEAD</b> of your local working copy. To send those changes to your remote repository, execute <br />
<code>git push origin master</code><br />
Change <i>master</i> to whatever branch you want to push your changes to.
<br /><br />
If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it with<br />
<code>git remote add origin &lt;server&gt;</code><br />
Now you are able to push your changes to the selected remote server<br />
</p>
</div>
<a name="branching"></a>
<div class="scrollblock block-branching">
<h2>branching</h2>
<p>
Branches are used to develop features isolated from each other. The <i>master</i> branch is the "default" branch when you create a repository. Use other branches for development and merge them back to the master branch upon completion.
</p>
<img src="img/branches.png" alt="" />
<p>
create a new branch named "feature_x" and switch to it using<br />
<code>git checkout -b feature_x</code><br />
switch back to master<br />
<code>git checkout master</code><br />
and delete the branch again<br />
<code>git branch -d feature_x</code><br />
a branch is <i>not available to others</i> unless you push the branch to your remote repository<br />
<code>git push origin &lt;branch&gt;</code>
</p>
</div>
<a name="update"></a>
<div class="scrollblock block-merging">
<h2>update &amp; merge</h2>
<p>
to update your local repository to the newest commit, execute <br />
<code>git pull</code><br />
in your working directory to <i>fetch</i> and <i>merge</i> remote changes.<br />
to merge another branch into your active branch (e.g. master), use<br />
<code>git merge &lt;branch&gt;</code><br />
in both cases git tries to auto-merge changes. Unfortunately, this is not always possible and results in <i>conflicts</i>.
You are responsible to merge those <i>conflicts</i>
manually by editing the files shown by git. After changing, you need to mark them as merged with<br />
<code>git add &lt;filename&gt;</code><br />
before merging changes, you can also preview them by using<br />
<code>git diff &lt;source_branch&gt; &lt;target_branch&gt;</code>
</p>
</div>
<a name="tagging"></a>
<div class="scrollblock block-tagging">
<h2>tagging</h2>
<p>
it's recommended to create tags for software releases. this is a known concept, which also exists in SVN. You can create a new tag named <i>1.0.0</i> by executing<br />
<code>git tag 1.0.0 1b2e1d63ff</code><br />
the <i>1b2e1d63ff</i> stands for the first 10 characters of the commit id you want to reference with your tag. You can get the commit id by looking at the... <br />
</p>
</div>
<a name="log"></a>
<div class="scrollblock block-log">
<h2>log</h2>
<p>
in its simplest form, you can study repository history using..
<code>git log</code><br />
You can add a lot of parameters to make the log look like what you want. To see only the commits of a certain author:<br />
<code>git log --author=bob</code><br />
To see a very compressed log where each commit is one line:<br />
<code>git log --pretty=oneline</code><br />
Or maybe you want to see an ASCII art tree of all the branches, decorated with the names of tags and branches: <br />
<code>git log --graph --oneline --decorate --all</code><br />
See only which files have changed: <br />
<code>git log --name-status</code><br />
These are just a few of the possible parameters you can use. For more, see
<code>git log --help</code><br />
</p>
</div>
<a name="checkout-replace"></a>
<div class="scrollblock block-checkout-replace">
<h2>replace local changes</h2>
<p>
In case you did something wrong, which for sure never happens ;), you can replace local changes using the command<br />
<code>git checkout -- &lt;filename&gt;</code><br />
this replaces the changes in your working tree with the last content in HEAD. Changes already added to the index, as well as new files, will be kept.
</p>
<p>
If you instead want to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it like this<br />
<code>git fetch origin</code><br />
<code>git reset --hard origin/master</code>
</p>
</div>
<a name="hints"></a>
<div class="scrollblock block-hints">
<h2>useful hints</h2>
<p>
built-in git GUI<br />
<code>gitk</code><br />
use colorful git output<br />
<code>git config color.ui true</code><br />
show log on just one line per commit<br />
<code>git config format.pretty oneline</code><br />
use interactive adding<br />
<code>git add -i</code>
</p>
</div>
<a name="resources"></a>
<div class="scrollblock block-resources">
<h2>links & resources</h2>
<h3>graphical clients</h3>
<p>
<ul>
<li><a href="http://gitx.laullon.com/">GitX (L) (OSX, open source)</a></li>
<li><a href="http://www.git-tower.com/">Tower (OSX)</a></li>
<li><a href="http://www.sourcetreeapp.com/">Source Tree (OSX & Windows, free)</a></li>
<li><a href="http://mac.github.com/">GitHub for Mac (OSX, free)</a></li>
<li><a href="https://itunes.apple.com/gb/app/gitbox/id403388357?mt=12">GitBox (OSX, App Store)</a></li>
</ul>
</p>
<h3>guides</h3>
<p>
<ul>
<li><a href="http://book.git-scm.com/">Git Community Book</a></li>
<li><a href="http://progit.org/book/">Pro Git</a></li>
<li><a href="http://think-like-a-git.net/">Think like a git</a></li>
<li><a href="http://help.github.com/">GitHub Help</a></li>
<li><a href="http://marklodato.github.com/visual-git-guide/index-en.html">A Visual Git Guide</a></li>
</ul>
</p>
<h3>get help</h3>
<p>
<ul>
<li><a href="http://groups.google.com/group/git-users/">Git User Mailing List</a></li>
<li><a href="http://jk.gs/git/">#git on irc.freenode.net</a></li>
</ul>
</p>
</div>
<a href="files/git_cheat_sheet.pdf" onClick="recordOutboundLink(this, 'Cheat Sheet', 'git-guide'); return false;" class="cheatsheet"></a>
</body>
</html>

@ -1,213 +1,201 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="fr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>git - the simple guide - no deep shit!</title> <title>git - petit guide - no deep shit!</title>
<link href='http://fonts.googleapis.com/css?family=Chelsea+Market' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Chelsea+Market' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/0/normalize.min.css" type="text/css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/0/normalize.min.css" type="text/css">
<link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/style.css" type="text/css">
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-652147-13']); _gaq.push(['_setAccount', 'UA-652147-13']);
_gaq.push(['_trackPageview']); _gaq.push(['_trackPageview']);
(function() { (function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; ga.type = 'text/javascript';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); ga.async = true;
})(); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
function recordOutboundLink(link, category, action) {
_gat._getTrackerByName()._trackEvent(category, action);
setTimeout('document.location = "' + link.href + '"', 100);
}
</script>
</head>
<body>
<div class="scrollblock block-title">
<h1>git - petit guide</h1>
<p>juste un petit guide pour bien d&eacute;marrer avec git. <!-- UNTRANSLATED -->no deep shit ;)</p>
<p class="meta">
<a href="index.en.html">english</a>
<br />
</p>
<img src="img/arrow.png" alt="" />
</div>
<!-- setup -->
<a name="setup"></a>
<div class="scrollblock block-setup">
<h2>installation</h2>
<p>
<a href="http://git-scm.com/download/mac">T&eacute;l&eacute;charger git pour Mac OSX</a>
</p>
<p>
<a href="http://msysgit.github.io/">T&eacute;l&eacute;charger git pour Windows</a>
</p>
<p>
<a href="http://book.git-scm.com/2_installing_git.html">T&eacute;l&eacute;charger git pour Linux</a>
</p>
</div>
<a name="create"></a>
<div class="scrollblock block-create">
<h2>cr&eacute;er un nouveau d&eacute;p&ocirc;t</h2>
<p>
cr&eacute;ez un nouveau dossier, ouvrez le et ex&eacute;cutez la commande<br />
<code>git init</code><br />
pour cr&eacute;er un nouveau d&eacute;p&ocirc;t.
</p>
</div>
<a name="checkout"></a>
<div class="scrollblock block-checkout">
<h2>cloner un d&eacute;p&ocirc;t</h2>
<p>
cr&eacute;ez une copie de votre d&eacute;p&ocirc;t local en ex&eacute;cutant la commande<br />
<code>git clone /path/to/repository</code><br />
si vous utilisez un serveur distant, cette commande sera<br />
<code>git clone username@host:/path/to/repository</code>
</p>
</div>
<a name="trees"></a>
<div class="scrollblock block-trees">
<h2>arbres</h2>
<p>
votre d&eacute;p&ocirc;t local est compos&eacute; de trois &quot;arbres&quot; g&eacute;r&eacute;s par git.
le premier est votre <code>espace de travail</code> qui contient réellement vos fichiers.
le second est un <code>Index</code> qui joue un r&ocirc;le d'espace de transit pour vos fichiers et
enfin <code>HEAD</code> qui pointe vers la derni&egrave;re validation que vous ayez faite.
</p>
<img src="img/trees.png" alt="" />
</div>
<a name="add"></a>
<div class="scrollblock block-add">
<h2>ajouter &amp; valider</h2>
<p>
Vous pouvez proposer un changement (l'ajouter &agrave; l'<b>Index</b>) en ex&eacute;cutant les commandes<br />
<code>git add &lt;filename&gt;</code><br />
<code>git add *</code><br />
C'est la premi&egrave;re &eacute;tape dans un workflow git basique. Pour valider ces changements, utilisez<br />
<code>git commit -m "Message de validation"</code><br />
Le fichier est donc ajout&eacute; au <b>HEAD</b>, mais pas encore dans votre d&eacute;p&ocirc;t distant.
</p>
</div>
<a name="push"></a>
<div class="scrollblock block-remote">
<h2>envoyer des changements</h2>
<p>
Vos changements sont maintenant dans le <b>HEAD</b> de la copie de votre d&eacute;p&ocirc;t local. Pour les envoyer &agrave; votre d&eacute;p&ocirc;t distant, ex&eacute;cutez la commande<br />
<code>git push origin master</code><br />
Remplacez <i>master</i> par la branche dans laquelle vous souhaitez envoyer vos changements.
<br /><br />
Si vous n'avez pas clon&eacute; votre d&eacute;p&ocirc;t existant et voulez le connecter &agrave; votre d&eacute;p&ocirc;t sur un serveur distant, vous devez l'ajouter avec<br />
<code>git remote add origin &lt;server&gt;</code><br />
Maintenant, vous pouvez envoyer vos changements vers le serveur distant s&eacute;lectionn&eacute;<br />
function recordOutboundLink(link, category, action) { </p>
_gat._getTrackerByName()._trackEvent(category, action); </div>
setTimeout('document.location = "' + link.href + '"', 100); <a name="branching"></a>
} <div class="scrollblock block-branching">
</script> <h2>branches</h2>
</head> <p>
<body> Les branches sont utilis&eacute;es pour d&eacute;velopper des fonctionnalit&eacute;s isol&eacute;es des autres.
<div class="scrollblock block-title"> La branche <i>master</i> est la branche par d&eacute;faut quand vous cr&eacute;ez un d&eacute;p&ocirc;t.
<h1>git - the simple guide</h1> Utilisez les autres branches pour le d&eacute;veloppement et fusionnez ensuite &agrave; la branche principale quand vous avez fini.
<p>just a simple guide for getting started with git. no deep shit ;)</p> </p>
<p class="meta"> <img src="img/branches.png" alt="" />
<a href="index.fr.html">français</a> <p>
<br /> cr&eacute;er une nouvelle branche nomm&eacute;e &quot;feature_x&quot; et <!-- BAD TRANSLATE -->passer dessus pour l'utiliser<br />
</p> <code>git checkout -b feature_x</code><br />
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=gitguide" id="_carbonads_js"></script> retourner sur la branche principale<br />
<img src="img/arrow.png" alt="" /> <code>git checkout master</code><br />
</div> et supprimer la branche<br />
<!-- setup --> <code>git branch -d feature_x</code><br />
<a name="setup"></a> une branche n'est <i>pas disponible pour les autres</i> tant que vous ne l'aurez pas envoy&eacute;e vers votre d&eacute;p&ocirc;t distant<br />
<div class="scrollblock block-setup"> <code>git push origin &lt;branch&gt;</code>
<h2>setup</h2> </p>
<p> </div>
<a href="http://git-scm.com/download/mac">Download git for OSX</a> <a name="update"></a>
</p> <div class="scrollblock block-merging">
<p> <h2>mettre &agrave; jour &amp; fusionner</h2>
<a href="http://msysgit.github.io/">Download git for Windows</a> <p>
</p> pour mettre &agrave; jour votre d&eacute;p&ocirc;t local vers les derni&egrave;res validations, ex&eacute;cutez la commande<br />
<p> <code>git pull</code><br />
<a href="http://git-scm.com/book/en/Getting-Started-Installing-Git">Download git for Linux</a> dans votre espace de travail pour <i>r&eacute;cup&eacute;rer</i> et <i>fusionner</i> les changements distants.<br />
</p> pour fusionner une autre branche avec la branche active (par exemple master), utilisez<br />
</div> <code>git merge &lt;branch&gt;</code><br />
<a name="create"></a> dans les deux cas, git tente d'auto-fusionner les changements. Malheureusement, &ccedil;a n'est pas toujours possible et r&eacute;sulte par des <i>conflits</i>.
<div class="scrollblock block-create"> Vous devez alors r&eacute;gler ces <i>conflits</i>
<h2>create a new repository</h2> manuellement en &eacute;ditant les fichiers indiqu&eacute;s par git. Apr&egrave;s l'avoir fait, vous devez les marquer comme fusionn&eacute;s avec<br />
<p> <code>git add &lt;filename&gt;</code><br />
create a new directory, open it and perform a <br /> apr&egrave;s avoir fusionn&eacute; les changements, vous pouvez en avoir un aper&ccedil;u en utilisant<br />
<code>git init</code><br /> <code>git diff &lt;source_branch&gt; &lt;target_branch&gt;</code>
to create a new git repository. </p>
</p> </div>
</div> <a name="tagging"></a>
<a name="checkout"></a> <div class="scrollblock block-tagging">
<div class="scrollblock block-checkout"> <h2>tags</h2>
<h2>checkout a repository</h2> <p>
<p> il est recommand&eacute; de cr&eacute;er des tags pour les releases de programmes. c'est un concept connu, qui existe aussi dans SVN. Vous pouvez cr&eacute;er un tag nomm&eacute; <i>1.0.0</i> en ex&eacute;cutant la commande<br />
create a working copy of a local repository by running the command<br /> <code>git tag 1.0.0 1b2e1d63ff</code><br />
<code>git clone /path/to/repository</code><br /> le <i>1b2e1d63ff</i> d&eacute;signe les 10 premiers caract&egrave;res de l'identifiant du changement que vous voulez r&eacute;f&eacute;rencer avec ce tag. Vous pouvez obtenir cet identifiant avec <br />
when using a remote server, your command will be<br /> <code>git log</code><br />
<code>git clone username@host:/path/to/repository</code> vous pouvez utiliser moins de caract&egrave;res de cet identifiant, il doit juste rester unique.
</p> </p>
</div> </div>
<a name="trees"></a> <a name="checkout-replace"></a>
<div class="scrollblock block-trees"> <div class="scrollblock block-checkout-replace">
<h2>workflow</h2> <h2>remplacer les changements locaux</h2>
<p> <p>
your local repository consists of three "trees" maintained by git. Dans le cas o&ugrave; vous auriez fait quelque chose de travers (ce qui bien entendu n'arrive jamais ;) vous pouvez annuler les changements locaux en utilisant cette commande<br />
the first one is your <code>Working Directory</code> which holds the actual files. <code>git checkout -- &lt;filename&gt;</code><br />
the second one is the <code>Index</code> which acts as a staging area and cela remplacera les changements dans votre arbre de travail avec le dernier contenu du HEAD. Les changements d&eacute;j&agrave; ajout&eacute;s &agrave; l'index, aussi bien les nouveaux fichiers, seront gard&eacute;s.
finally the <code>HEAD</code> which points to the last commit you've made. </p>
</p> <p>
<img src="img/trees.png" alt="" /> Si &agrave; la place vous voulez supprimer tous les changements et validations locaux, r&eacute;cup&eacute;rez le dernier historique depuis le serveur et pointez la branche principale locale dessus comme ceci<br />
</div> <code>git fetch origin</code><br />
<a name="add"></a> <code>git reset --hard origin/master</code>
<div class="scrollblock block-add"> </p>
<h2>add &amp; commit</h2> </div>
<p> <a name="hints"></a>
You can propose changes (add it to the <b>Index</b>) using<br /> <div class="scrollblock block-hints">
<code>git add &lt;filename&gt;</code><br /> <h2>conseils utiles</h2>
<code>git add *</code><br /> <p>
This is the first step in the basic git workflow. To actually commit these changes use<br /> Interface git incluse<br />
<code>git commit -m "Commit message"</code><br /> <code>gitk</code><br />
Now the file is committed to the <b>HEAD</b>, but not in your remote repository yet. utiliser des couleurs dans la sortie de git<br />
</p> <code>git config color.ui true</code><br />
</div> afficher le journal sur une seule ligne pour chaque validation<br />
<a name="push"></a> <code>git config format.pretty oneline</code><br />
<div class="scrollblock block-remote"> utiliser l'ajout interactif<br />
<h2>pushing changes</h2> <code>git add -i</code>
<p> </p>
Your changes are now in the <b>HEAD</b> of your local working copy. To send those changes to your remote repository, execute <br /> </div>
<code>git push origin master</code><br /> <a name="resources"></a>
Change <i>master</i> to whatever branch you want to push your changes to. <div class="scrollblock block-resources">
<br /><br /> <h2>liens et ressources</h2>
If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it with<br /> <h3>clients graphiques</h3>
<code>git remote add origin &lt;server&gt;</code><br /> <p>
Now you are able to push your changes to the selected remote server<br /> <ul>
<li><a href="http://gitx.laullon.com/">GitX (L) (OSX, open source)</a></li>
</p> <li><a href="http://www.git-tower.com/">Tower (OSX)</a></li>
</div> <li><a href="http://www.sourcetreeapp.com/">Source Tree (OSX, free)</a></li>
<a name="branching"></a> <li><a href="http://mac.github.com/">GitHub for Mac (OSX, free)</a></li>
<div class="scrollblock block-branching"> <li><a href="https://itunes.apple.com/gb/app/gitbox/id403388357?mt=12">GitBox (OSX)</a></li>
<h2>branching</h2> <li><a href="https://code.google.com/p/gitextensions/">Git Extensions (WIN, open source)</a></li>
<p> </ul>
Branches are used to develop features isolated from each other. The <i>master</i> branch is the "default" branch when you create a repository. Use other branches for development and merge them back to the master branch upon completion. </p>
</p>
<img src="img/branches.png" alt="" />
<p>
create a new branch named "feature_x" and switch to it using<br />
<code>git checkout -b feature_x</code><br />
switch back to master<br />
<code>git checkout master</code><br />
and delete the branch again<br />
<code>git branch -d feature_x</code><br />
a branch is <i>not available to others</i> unless you push the branch to your remote repository<br />
<code>git push origin &lt;branch&gt;</code>
</p>
</div>
<a name="update"></a>
<div class="scrollblock block-merging">
<h2>update &amp; merge</h2>
<p>
to update your local repository to the newest commit, execute <br />
<code>git pull</code><br />
in your working directory to <i>fetch</i> and <i>merge</i> remote changes.<br />
to merge another branch into your active branch (e.g. master), use<br />
<code>git merge &lt;branch&gt;</code><br />
in both cases git tries to auto-merge changes. Unfortunately, this is not always possible and results in <i>conflicts</i>.
You are responsible to merge those <i>conflicts</i>
manually by editing the files shown by git. After changing, you need to mark them as merged with<br />
<code>git add &lt;filename&gt;</code><br />
before merging changes, you can also preview them by using<br />
<code>git diff &lt;source_branch&gt; &lt;target_branch&gt;</code>
</p>
</div>
<a name="tagging"></a>
<div class="scrollblock block-tagging">
<h2>tagging</h2>
<p>
it's recommended to create tags for software releases. this is a known concept, which also exists in SVN. You can create a new tag named <i>1.0.0</i> by executing<br />
<code>git tag 1.0.0 1b2e1d63ff</code><br />
the <i>1b2e1d63ff</i> stands for the first 10 characters of the commit id you want to reference with your tag. You can get the commit id by looking at the... <br />
</p>
</div>
<a name="log"></a>
<div class="scrollblock block-log">
<h2>log</h2>
<p>
in its simplest form, you can study repository history using..
<code>git log</code><br />
You can add a lot of parameters to make the log look like what you want. To see only the commits of a certain author:<br />
<code>git log --author=bob</code><br />
To see a very compressed log where each commit is one line:<br />
<code>git log --pretty=oneline</code><br />
Or maybe you want to see an ASCII art tree of all the branches, decorated with the names of tags and branches: <br />
<code>git log --graph --oneline --decorate --all</code><br />
See only which files have changed: <br />
<code>git log --name-status</code><br />
These are just a few of the possible parameters you can use. For more, see
<code>git log --help</code><br />
</p>
</div>
<a name="checkout-replace"></a>
<div class="scrollblock block-checkout-replace">
<h2>replace local changes</h2>
<p>
In case you did something wrong, which for sure never happens ;), you can replace local changes using the command<br />
<code>git checkout -- &lt;filename&gt;</code><br />
this replaces the changes in your working tree with the last content in HEAD. Changes already added to the index, as well as new files, will be kept.
</p>
<p>
If you instead want to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it like this<br />
<code>git fetch origin</code><br />
<code>git reset --hard origin/master</code>
</p>
</div>
<a name="hints"></a>
<div class="scrollblock block-hints">
<h2>useful hints</h2>
<p>
built-in git GUI<br />
<code>gitk</code><br />
use colorful git output<br />
<code>git config color.ui true</code><br />
show log on just one line per commit<br />
<code>git config format.pretty oneline</code><br />
use interactive adding<br />
<code>git add -i</code>
</p>
</div>
<a name="resources"></a>
<div class="scrollblock block-resources">
<h2>links & resources</h2>
<h3>graphical clients</h3>
<p>
<ul>
<li><a href="http://gitx.laullon.com/">GitX (L) (OSX, open source)</a></li>
<li><a href="http://www.git-tower.com/">Tower (OSX)</a></li>
<li><a href="http://www.sourcetreeapp.com/">Source Tree (OSX & Windows, free)</a></li>
<li><a href="http://mac.github.com/">GitHub for Mac (OSX, free)</a></li>
<li><a href="https://itunes.apple.com/gb/app/gitbox/id403388357?mt=12">GitBox (OSX, App Store)</a></li>
</ul>
</p>
<h3>guides</h3> <h3>guides</h3>
<p> <p>
<ul> <ul>
@ -218,14 +206,7 @@
<li><a href="http://marklodato.github.com/visual-git-guide/index-en.html">A Visual Git Guide</a></li> <li><a href="http://marklodato.github.com/visual-git-guide/index-en.html">A Visual Git Guide</a></li>
</ul> </ul>
</p> </p>
<h3>get help</h3> </div>
<p> <a href="files/git_cheat_sheet.pdf" onClick="recordOutboundLink(this, 'Cheat Sheet', 'git-guide'); return false;" class="cheatsheet"></a>
<ul>
<li><a href="http://groups.google.com/group/git-users/">Git User Mailing List</a></li>
<li><a href="http://jk.gs/git/">#git on irc.freenode.net</a></li>
</ul>
</p>
</div>
<a href="files/git_cheat_sheet.pdf" onClick="recordOutboundLink(this, 'Cheat Sheet', 'git-guide'); return false;" class="cheatsheet"></a>
</body> </body>
</html> </html>

Loading…
Cancel
Save