2010-08-23 12:26:48 +00:00
<?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/twilight.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 >
< title > Git for n00b< / title >
< / head >
< body lang = "en" >
< script type = "text/javascript" > / / < ! [ C D A T A [
document.write('< div id = "blackpage" > < img src = "/Scratch/img/loading.gif" alt = "loading..." / > < / div > ');
// ]]>
< / script >
< div id = "content" >
2010-09-27 18:49:15 +00:00
< div id = "choix" >
< div class = "return" > < a href = "#entete" > ↓ Menu ↓ < / 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 >
< img src = "/Scratch/img/presentation.png" alt = "Presentation drawing" / >
2010-08-23 12:26:48 +00:00
< 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< / a > < / li > < li > < a href = "/Scratch/en/blog/2009-11-12-Git-for-n00b/Git-pour-quoi-faire/" > Git for what?< / a > < / li > < li > < a href = "/Scratch/en/blog/2009-11-12-Git-for-n00b/conf-et-install/" > Configure before Use< / a > < / li > < li > < a href = "/Scratch/en/blog/2009-11-12-Git-for-n00b/c-est-parti-pour-l-aventure/" > The Adventure Begins< / a > < / li > < li > < a href = "/Scratch/en/blog/2009-11-12-Git-for-n00b/comprendre/" > Understanding< / a > < / li > < li > < span class = "active" title = "You're here." > Command List< / 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 class = "navigation" >
2010-09-27 20:14:09 +00:00
< div class = "navigationprev" > < a href = "/Scratch/en/blog/2009-11-12-Git-for-n00b/comprendre/" > < span class = "nicer" > «< / span > previous< / a > < / div >
2010-08-23 12:26:48 +00:00
< div class = "navigationnext" > < / div >
< / div >
< div class = "flush" > < / 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 >
Vous devez activer javascript pour commenter.
< / noscript >
< script type = "text/javascript" >
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '/Scratch/en/blog/2009-11-12-Git-for-n00b/';
var idcomments_post_url = 'http://yannesposito.com/Scratch/en/blog/2009-11-12-Git-for-n00b/';
< / 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/" > Homepage< / a > < / li >
< li > < a href = "/Scratch/en/blog/" > Blog< / a > < / li >
2010-09-30 13:01:14 +00:00
< li > < a href = "/Scratch/en/softwares/" > Softwares< / a > < / li >
2010-09-28 01:00:51 +00:00
< li > < a href = "/Scratch/en/about/" > About< / a > < / li > < / ul >
2010-08-23 12:26:48 +00:00
< / div >
< div class = "flush" > < / div >
< hr / >
< div id = "next_before_articles" >
< div id = "previous_articles" >
previous entries
< div class = "previous_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2009-10-30-How-to-handle-evil-IE/" > < span class = "nicer" > «< / span > How to handle evil IE< / a >
2010-08-23 12:26:48 +00:00
< / div >
< div class = "previous_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2009-10-28-custom-website-synchronisation-with-mobileme--2-/" > < span class = "nicer" > «< / span > custom website synchronisation with mobileme (2)< / a >
2010-08-23 12:26:48 +00:00
< / div >
< div class = "previous_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2009-10-Wait-to-hide-a-menu-in-jQuery/" > < span class = "nicer" > «< / span > Menu waiting to hide himself< / a >
2010-08-23 12:26:48 +00:00
< / div >
< / div >
< div id = "next_articles" >
next entries
< div class = "next_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2009-12-06-iphone-call-filter/" > iphone call filter < span class = "nicer" > »< / span > < / a >
2010-08-23 12:26:48 +00:00
< / div >
< div class = "next_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2009-12-14-Git-vs--Bzr/" > Git vs. Bzr < span class = "nicer" > »< / span > < / a >
2010-08-23 12:26:48 +00:00
< / div >
< div class = "next_article" >
2010-09-28 15:10:12 +00:00
< a href = "/Scratch/en/blog/2010-01-04-Change-default-shell-on-Mac-OS-X/" > Change default shell on Mac OS X < span class = "nicer" > »< / span > < / a >
2010-08-23 12:26:48 +00:00
< / div >
< / div >
< div class = "flush" > < / div >
< / div >
< / div >
< div id = "bottom" >
< div >
< a rel = "license" href = "http://creativecommons.org/licenses/by-sa/3.0/" > Copyright ©, Yann Esposito< / a >
< / div >
< div id = "lastmod" >
2010-08-31 13:06:43 +00:00
Created: 11/12/2009
2010-09-02 09:51:46 +00:00
Modified: 05/09/2010
2010-08-23 12:26:48 +00:00
< / div >
< div >
Entirely done with
< a href = "http://www.vim.org" > Vim< / a >
and
< a href = "http://nanoc.stoneship.org" > nanoc< / a >
< / div >
< div >
< a href = "/Scratch/en/validation/" > Validation< / a >
< a href = "http://validator.w3.org/check?uri=referer" > [xhtml] < / a >
.
< a href = "http://jigsaw.w3.org/css-validator/check/referer?profile=css3" > [css] < / a >
.
< a href = "http://validator.w3.org/feed/check.cgi?url=http%3A//yannesposito.com/Scratch/en/blog/feed/feed.xml" > [rss]< / a >
< / div >
< / div >
< div class = "clear" > < / div >
< / div >
< / body >
< / html >