Changes between Initial Version and Version 1 of SmokinGuns/Building/git

Dec 24, 2013 5:18:30 PM (4 years ago)



  • SmokinGuns/Building/git

    v1 v1  
     1= Introduction = 
     2This wiki aims to make a quick and short explanation about how to use git for Smokin' Guns. For more details, it is highly recommended to look for some other wikis over the Internet. 
     3Git is the software that manage the SG codebase. You can get a Linux support via the packet usually named {{{git}}}. On Windows, you will have to download {{{git bash}}} via this [ link]. 
     5= Content = 
     6* cloning 
     7* branches 
     8* diff 
     9* patch 
     10* commit 
     11* tag 
     13== Cloning == 
     14You need to clone a repository when you need to modify the code on your computer. 
     15You just need to know: 
     17git clone <url> 
     19== Branches == 
     20A branch is a separate working copy into a git repository. 
     21For creating a new branch: 
     23git branch <name> 
     25For setting which branch to use (default is master): 
     27git checkout <name> 
     30== Diff == 
     31The same says everything: get the difference between the last commit and the actual code. 
     32To show the differences: 
     34git diff 
     36If you want to save the changes in a file: 
     38git diff > file.diff 
     40And if you want to patch it later, just do: 
     42patch -p1 < file.diff 
     45== Commit == 
     46You firstly need to save your changes, then commit it. And then if you want it, push it to the server. All commits have an unique ID. 
     47Add all files to the commit: 
     49git add * 
     51Making the commit: 
     53git commit 
     55You will need to write a small description then save your changes. 
     57Sending it to the server: 
     59git push 
     62If you want to update your existing code, use {{{git pull}}}. If you want to show the commit log, use {{{git log}}} or {{{git show <id>}}} 
     64== Tag == 
     65A tag is a static picture of the current codebase. It's very helpful to be sure what a release had. 
     66Listing all tags: 
     68git tag 
     70Creating a new tag: 
     72git tag -a <version> -m '<version comment>' 
     74Then you need to send them to the server: 
     76git push origin --tags