Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git:quick-start-guide [2008/11/27 14:02]
andrei
git:quick-start-guide [2011/02/23 10:11] (current)
ibc Added section "Local GIT settings: global and per-repository settings"
Line 6: Line 6:
 ===== GIT URLs ===== ===== GIT URLs =====
  
-  * git://git.sip-router.org/sip-router - (read only) +  * %%git://git.sip-router.org/sip-router%% - (read only) 
-  * http://git.sip-router.org/sip-router - (read only, slower, git://... recommended) +  * http://git.sip-router.org/sip-router - (read only, slower, %%git://...%% recommended) 
-  * ssh://git.sip-router.org/sip-router - (read/write, developer account needed on git.sip-router.org)+  * %%ssh://git.sip-router.org/sip-router%% - (read/write, developer account needed on git.sip-router.org)
  
  
Line 14: Line 14:
  
   * http://git.sip-router.org/cgi-bin/gitweb.cgi   * http://git.sip-router.org/cgi-bin/gitweb.cgi
 +
 +
 +===== Local GIT settings: global and per-repository settings =====
 +
 +GIT allows setting global configuration parameters by using the command ''git config --global''. These settings are stored into ''$HOME/.gitconfig'' and are global for all our local GIT repositories.
 +
 +''git config'' without ''--global'' option must be executed in the root directory of a local GIT repository. Such settings are stored in ''.git/config'' within the repository and are just specific for current GIT repository. They take preference over global settings (in case the same configuration parameter exists in both ''$HOME/.gitconfig'' and ''REPOSITORY/.git/config'').
  
  
Line 21: Line 28:
   * First of all, set your name and email address:   * First of all, set your name and email address:
 <code> <code>
-git config --global user.name \'your_name\+git config --global user.name 'your_name' 
-git config --global user.email \'your email address\'+git config --global user.email 'your email address'
 </code> </code>
  
- Some other recommended git config setting: +Some other recommended git config setting: 
-   * include summaries of merged commits in commit merge messages (a MUST)+ 
 +   * include summaries of merged commits in commit merge messages (a **MUST**)
 <code> <code>
 git config --global merge.log true git config --global merge.log true
Line 35: Line 43:
 git config --global branch.autosetupmerge always git config --global branch.autosetupmerge always
 </code> </code>
 +   * by default perform a rebase instead of a merge when pulling into the local master branch (highly recommended, it gets rid of a lot of confusing merge origin/master messages). It's equivalent to adding **--rebase** to git pull command line. (**recommended**)
 +<code>
 +git config branch.master.rebase true
 +</code>
 +   * by default setup all new local branches to perform rebase (like above) when pull-ing (so that you don't have to run //git config branch.%%<branchname>%%.rebase true// for each of them).
 +<code>
 +git config branch.autosetuprebase always  # or remote
 +</code>
 +   * (**not recommended**) by default use --no-ff when merging into master (this means that a merge commit message will be generated for all merges; without it fast-forward merges will not generate a merge message). **Note**: --no-ff will generate merge logs even when updating master from origin (git pull origin master), which is not what you want. You should either use "-**-no-ff**" by default like described below, but then make sure to add "**--ff**" every time you update your local master version (git pull **--ff** origin master), or you don't use it, but then always remember to add "-**-no-ff**" when merging some other branch into master (e.g.: git merge **--no-ff** origin/foo).
 +<code>
 +# _not_ recommended, use _only_ if you do a _lot_ of merges between public
 +# branches (see Note: above), otherwise you're better off without it
 +# git config branch.master.mergeoptions  "--no-ff"
 +</code>
 +
 +===== GIT commit into master howto =====
 +
 +Please see [[git:commit-into-master|GIT commit into master howto]]
 +
 +===== GIT merge into master howto =====
  
 +Please see [[git:merge-into-master|GIT merge into master howto]]

Navigation

Wiki

Other

QR Code
QR Code git:quick-start-guide (generated for current page)