scratch/output/Scratch/en/blog/2009-11-12-Git-for-n00b/commandes-avancees/index.html
Yann Esposito (Yogsototh) 57d77cd030 Regen complete
2012-04-02 23:43:39 +02:00

290 lines
No EOL
10 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="git">
<link rel="shortcut icon" type="image/x-icon" href="/Scratch/img/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/Scratch/assets/css/main.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/solarized.css" />
<link rel="stylesheet" type="text/css" href="/Scratch/css/idc.css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://feeds.feedburner.com/yannespositocomen"/>
<link rel="alternate" lang="fr" xml:lang="fr" title="Git pour les nuls" type="text/html" hreflang="fr" href="/Scratch/fr/blog/2009-11-12-Git-for-n00b/commandes-avancees/" />
<link rel="alternate" lang="en" xml:lang="en" title="Git for n00b" type="text/html" hreflang="en" href="/Scratch/en/blog/2009-11-12-Git-for-n00b/commandes-avancees/" />
<script type="text/javascript" src="/Scratch/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/Scratch/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Scratch/js/index.js"></script>
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
<title>Git for n00b</title>
</head>
<body lang="en" class="article">
<script type="text/javascript">// <![CDATA[
document.write('<div id="blackpage"><img src="/Scratch/img/loading.gif" alt="loading..."/></div>');
// ]]>
</script>
<div id="content">
<div id="choix">
<div class="return"><a href="#entete">&darr; Menu &darr;</a></div>
<div id="choixlang">
<a href="/Scratch/fr/blog/2009-11-12-Git-for-n00b/commandes-avancees/" onclick="setLanguage('fr')">en Français</a>
</div>
<div class="flush"></div>
</div>
<div id="titre">
<h1>
Git for n00b
</h1>
<h2>
Command List
</h2>
</div>
<div class="flush"></div>
<div id="sousliens"><ul><li><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/">introduction <span class="nicer">&raquo;</span></a></li><li><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/Git-pour-quoi-faire/">Git for what? <span class="nicer">&raquo;</span></a></li><li><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/conf-et-install/">Configure before Use <span class="nicer">&raquo;</span></a></li><li><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/c-est-parti-pour-l-aventure/">The Adventure Begins <span class="nicer">&raquo;</span></a></li><li><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/comprendre/">Understanding <span class="nicer">&raquo;</span></a></li><li><span class="active" title="You're here.">Command List <span class="nicer">&raquo;</span></span></li></ul></div>
<div class="flush"></div>
<div id="afterheader">
<div class="corps">
<h1 class="first" id="command-list">Command List</h1>
<h2 id="command-for-each-functionality">Command for each functionality</h2>
<p>In the first part, we saw the list of resolved problem by <a href="http://git-scm.org" title="Git">Git</a>. To resume <a href="http://git-scm.org" title="Git">Git</a> should do:</p>
<ul>
<li>get others modifications,</li>
<li>send modifications to others,</li>
<li>get back in time,</li>
<li>list differences between each version,</li>
<li>name some versions in order to refer easily to them,</li>
<li>write an historic of modifications,</li>
<li>know who did what and when,</li>
<li>manage conflicts,</li>
<li>easily manage branches.</li>
</ul>
<h3 id="get-others-modifications">get others modifications</h3>
<div><pre class="twilight">
$ git pull
</pre></div>
<h3 id="send-modifications-to-others">send modifications to others</h3>
<div><pre class="twilight">
$ git push
</pre></div>
<p>or more generally</p>
<div><pre class="twilight">
$ git pull
$ git push
</pre></div>
<h3 id="get-back-in-time">get back in time</h3>
<h4 id="for-all-tree">For all tree</h4>
<div><pre class="twilight">
$ git checkout
</pre></div>
<div><pre class="twilight">
$ git revert
</pre></div>
<p>revert three version before (see my <code>.gitconfig</code> file).</p>
<div><pre class="twilight">
$ git uncommit 3
</pre></div>
<p>Undo the las merge (if something goes wrong)</p>
<div><pre class="twilight">
$ git revertbeforemerge
</pre></div>
<h4 id="for-one-file">For one file</h4>
<div><pre class="twilight">
$ git checkout file
$ git checkout VersionHash file
$ git checkout HEAD~3 file
</pre></div>
<h3 id="list-differences-between-each-version">list differences between each version</h3>
<p>list files being modified</p>
<div><pre class="twilight">
$ git status
</pre></div>
<p>differences between last version files and local files</p>
<div><pre class="twilight">
$ git diff
</pre></div>
<p>differences between some version and local files</p>
<div><pre class="twilight">
$ git diff VersionHash fichier
</pre></div>
<h3 id="name-some-version-to-refer-to-them-in-the-future">name some version to refer to them in the future</h3>
<div><pre class="twilight">
$ git tag <span class="String"><span class="String">'</span>toto<span class="String">'</span></span>
</pre></div>
<h3 id="show-historic-of-modifications">show historic of modifications</h3>
<div><pre class="twilight">
$ git log
$ git lg
$ git logfull
</pre></div>
<h3 id="know-who-did-what-and-when">know who did what and when</h3>
<div><pre class="twilight">
$ git blame fichier
</pre></div>
<h3 id="handle-conflicts">handle conflicts</h3>
<div><pre class="twilight">
$ git conflict
</pre></div>
<h3 id="manage-branches">manage branches</h3>
<p>To create a branch: </p>
<div><pre class="twilight">
$ git branch branch_name
</pre></div>
<p>To change the current branch: </p>
<div><pre class="twilight">
$ git checkout branch_name
</pre></div>
</div>
<div id="choixrss">
<a id="rss" href="http://feeds.feedburner.com/yannespositocomen">
Subscribe
</a>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#comment').hide();
$('#clickcomment').click(showComments);
});
function showComments() {
$('#comment').show();
$('#clickcomment').fadeOut();
}
document.write('<div id="clickcomment">Comments</div>');
</script>
<div class="flush"></div>
<div class="corps" id="comment">
<h2 class="first">comments</h2>
<noscript>
You must enable javascript to comment.
</noscript>
<script type="text/javascript">
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '/Scratch/en/blog/2009-11-12-Git-for-n00b/commandes-avancees/';
var idcomments_post_url = 'http://yannesposito.com/Scratch/en/blog/2009-11-12-Git-for-n00b/commandes-avancees/';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='/Scratch/js/genericCommentWrapperV2.js'></script>
</div>
<div id="entete" class="corps_spaced">
<div id="liens">
<ul><li><a href="/Scratch/en/">Home</a></li>
<li><a href="/Scratch/en/blog/">Blog</a></li>
<li><a href="/Scratch/en/softwares/">Softwares</a></li>
<li><a href="/Scratch/en/about/">About</a></li></ul>
</div>
<div class="flush"></div>
<hr/>
<div id="next_before_articles">
<div id="previous_articles">
previous entries
<div class="previous_article">
<a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/comprendre/"><span class="nicer">«</span>&nbsp;Git for n00b</a>
</div>
<div class="previous_article">
<a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/c-est-parti-pour-l-aventure/"><span class="nicer">«</span>&nbsp;Git for n00b</a>
</div>
<div class="previous_article">
<a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/conf-et-install/"><span class="nicer">«</span>&nbsp;Git for n00b</a>
</div>
</div>
<div id="next_articles">
next entries
</div>
<div class="flush"></div>
</div>
</div>
<div id="bottom">
<div>
<a href="http://twitter.com/yogsototh">Follow me</a>
</div>
<div>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Copyright ©, Yann Esposito</a>
</div>
<div id="lastmod">
Created: 11/12/2009
Modified: 05/09/2010
</div>
<div>
Entirely done with
<a href="http://www.vim.org">Vim</a>
and
<a href="http://nanoc.stoneship.org">nanoc</a>
</div>
</div>
<div class="clear"></div>
</div>
</body>
</html>