{"id":66,"date":"2009-05-26T20:05:07","date_gmt":"2009-05-26T18:05:07","guid":{"rendered":"http:\/\/46.105.150.90\/tstnunix\/?p=66"},"modified":"2009-05-26T20:05:07","modified_gmt":"2009-05-26T18:05:07","slug":"manage-your-source-code","status":"publish","type":"post","link":"https:\/\/nunix.fr\/?p=66","title":{"rendered":"Git git git"},"content":{"rendered":"<p>Maybe you know some SCM (revision control system) like CVS, Subversion or Perfoce.Cool, but you are already late.<\/p>\n<p>Since many years now, new sort of system came up. They are called <a href=\"http:\/\/en.wikipedia.org\/wiki\/Distributed_revision_control\">DCVS<\/a>, and let&rsquo;s called them \u00ab\u00a0decentralized\u00a0\u00bb, or \u00ab\u00a0distributed\u00a0\u00bb. Famous systems are Git, but also Darcs, Mercurial, or Bazaar.<\/p>\n<p>The main difference with \u00ab\u00a0distributed\u00a0\u00bb systems compare to \u00ab\u00a0centralized\u00a0\u00bb are we do not need a central repository. Anyone is able to create and manage it&rsquo;s own repository, locally, or merge it&rsquo;s branch with another one somewhere on internet, etc.\u00a0 <\/p>\n<p>To put it on a nutsheel, Git has been developped by Linus Torvald to manage linux kernel source code. It&rsquo;s a powerfull system which can manage branch, diff, interface with svn, etc. There is lot of documentation, and I&rsquo;ll\u00a0 give some links to start with git, and few commands to manage a project locally.<\/p>\n<p> <!--more--> <\/p>\n<p>The basic thing you may use : you are writing a project locally, and want to add a simple versionning system :<\/p>\n<pre>cd ~path\/to\/my\/project<br \/>git init<br \/>git add .<br \/>git commit -m \"Initial commit, or whatever message you want to say\" -a<\/pre>\n<p>\u00a0And that&rsquo;s it. When you want to commit your work, just do a git commit -m \u00ab\u00a0message\u00a0\u00bb -a<\/p>\n<p>If you made a mistake, you may want to revert to the previous commit :<\/p>\n<pre>git revert HEAD<\/pre>\n<p>Yeah, you know enough to start with git. No more excuse if you make mistake on your project now. <\/p>\n<p>Some references :<\/p>\n<ul>\n<li><a href=\"http:\/\/git-scm.com\/\">http:\/\/git-scm.com\/<\/a> : official web site<\/li>\n<\/ul>\n<ul>\n<li><a href=\"http:\/\/ktown.kde.org\/~zrusin\/git\/git-cheat-sheet-large.png\">http:\/\/ktown.kde.org\/~zrusin\/git\/git-cheat-sheet-large.png<\/a> : a picture to control everything<\/li>\n<\/ul>\n<ul>\n<li><a href=\"http:\/\/toolmantim.com\/articles\/setting_up_a_new_remote_git_repository\">http:\/\/toolmantim.com\/articles\/setting_up_a_new_remote_git_repository<\/a> : a tutorial to create a central repository where we can \u00ab\u00a0commit\u00a0\u00bb too {jcomments on}<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Maybe you know some SCM (revision control system) like CVS, Subversion or Perfoce.Cool, but you are already late. Since many years now, new sort of system came up. They are called DCVS, and let&rsquo;s called them \u00ab\u00a0decentralized\u00a0\u00bb, or \u00ab\u00a0distributed\u00a0\u00bb. Famous systems are Git, but also Darcs, Mercurial, or Bazaar. The main difference with \u00ab\u00a0distributed\u00a0\u00bb systems &hellip; <a href=\"https:\/\/nunix.fr\/?p=66\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Git git git&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-outils-de-programmation"],"_links":{"self":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66"}],"version-history":[{"count":0,"href":"https:\/\/nunix.fr\/index.php?rest_route=\/wp\/v2\/posts\/66\/revisions"}],"wp:attachment":[{"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nunix.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}