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
Last revision Both sides next revision
git:gitconfig [2009/02/18 12:18]
janakj
git:gitconfig [2009/04/16 17:24]
212.227.35.68
Line 10: Line 10:
 <code> <code>
 [user] [user]
-        name = <Your Name> +    name = <Your Name> 
-        email = <your email address>+    email = <your email address>
  
 [core] [core]
-        # Ignore backup and temporary files produced by Emacs in all repositories. +    # Ignore backup and temporary files produced by Emacs in all repositories. 
-        # The file below contains a list of patterns to match Emacs backup and +    # The file below contains a list of patterns to match Emacs backup and 
-        # temporary files (note that you need to provide full path to the file +    # temporary files (note that you need to provide full path to the file 
-        # because git would not expand ~). +    # because git would not expand ~). Uncomment the following option if you 
-        excludesfile = /home/<your username>/.gitignore+    # want to use a global .gitignore file. 
 +    #excludesfile = /home/<your username>/.gitignore
  
 [format] [format]
-        # Add the patch number and the total number of patches in the series to +    # Add the patch number and the total number of patches in the series to 
-        # the subject of the patch email if more than one patch is being produced. +    # the subject of the patch email if more than one patch is being produced. 
-        numbered = auto+    numbered = auto
  
 [gc] [gc]
-        # Do not remove references under .git/refs/heads and .git/refs/tags when +    # Do not remove references under .git/refs/heads and .git/refs/tags when 
-        # git gc is run. The default behavior of git-gc is to pack the references +    # git gc is run. The default behavior of git-gc is to pack the references 
-        # and store the packed references in .git/packed-refs. I personally find +    # and store the packed references in .git/packed-refs. I personally find 
-        # the references kept in files under .git/refs very useful, they make the +    # the references kept in files under .git/refs very useful, they make the 
-        # retrieval of branch or tag info very easy from a shell script so I do +    # retrieval of branch or tag info very easy from a shell script so I do 
-        # not want to have them packed when I run git-gc. +    # not want to have them packed when I run git-gc. 
-        packrefs = 0+    packrefs = 0
  
 [sendemail] [sendemail]
-        # Do not add the e-mail address from Signed-off-by and CC headers to the +    # Do not add the e-mail address from Signed-off-by and CC headers to the 
-        # list of recipients. The default setting would send me a copy of every +    # list of recipients. The default setting would send me a copy of every 
-        # patch I sign off--which I do not want. +    # patch I sign off--which I do not want. 
-        suppressfrom = true+    suppressfrom = true
  
-        # Set the envelope sender address explicitly. I configured my local +    # Set the envelope sender address explicitly. I configured my local 
-        # postfix server to select the outbound SMTP server based on the sender +    # postfix server to select the outbound SMTP server based on the sender 
-        # address in the envelope so it is important that we have a correct email +    # address in the envelope so it is important that we have a correct email 
-        # address there. +    # address there. 
-        envelopesender = <your email address>+    envelopesender = <your email address>
  
 [alias] [alias]
-        ci = commit +    ci = commit 
-        co = checkout +    co = checkout 
-        f  = fetch +    f  = fetch 
-        s = status +    s = status 
-        b = branch +    b = branch 
-        d = diff +    d = diff 
-        a = add +    a = add 
-        l = log+    l = log
  
 [color] [color]
-        branch = auto +    branch = auto 
-        diff = auto +    diff = auto 
-        status = auto+    status = auto
  
 [http] [http]
-        # The CA certificate used to verify servers in sip-router.org domain, this +    # The CA certificate used to verify servers in sip-router.org domain, this 
-        # is useful if you pull from, for example, https://git.sip-router.org. +    # is useful if you pull from, for example, https://git.sip-router.org. 
-        # Uncomment the following configuration option if you have the CA certificate +    # Uncomment the following configuration option if you have the CA certificate 
-        # installed. +    # installed. 
-        #sslCAInfo = /etc/ssl/certs/sip-router.org_CA.pem+    #sslCAInfo = /etc/ssl/certs/sip-router.org_CA.pem
  
 [merge] [merge]
-        # Include the summary of merged commits into all newly created merge +    # Include the summary of merged commits into all newly created merge 
-        # commits. The newly created merge commit will contain a one-line summary +    # commits. The newly created merge commit will contain a one-line summary 
-        # of every (well, most) merged commits. +    # of every (well, most) merged commits. 
-        log = true+    log = true
  
-        # Show merge statistics after merge. +    # Show merge statistics after merge. 
-        stat = true+    stat = true
  
 [branch] [branch]
-        # When creating a new branch off a remote branch, always set it up to +    # When creating a new branch off a remote branch, always set it up to 
-        # track the remote branch so that we can pull from there. +    # track the remote branch so that we can pull from there. 
-        autoseupmerge = always+    autoseupmerge = always 
 + 
 +[branch "master"
 +    # This is the list of cmdline options that should be added to git-merge                                      
 +    # when I merge commits into the master branch.                                                               
 +    #                                                                                                            
 +    # First off, the option --no-commit instructs git not to commit the merge                                    
 +    # by default. This allows me to do some final adjustment to the commit log                                   
 +    # message before it gets commited. I often use this to add extra info to                                     
 +    # the merge message or rewrite my local branch names in the commit message                                   
 +    # to branch names sensible to the casual reader of the git log.                                              
 +    #                                                                                                            
 +    # Option --no-ff instructs git to always record a merge commit, even if                                      
 +    # the branch being merged into can be fast-forwarded. This is often the                                      
 +    # case when you create a short-lived topic branch which tracks master, do                                    
 +    # some changes on the topic branch and then merge the changes into the                                       
 +    # master which remained unchanged while you were doing your work on the                                      
 +    # topic branch. In this case the master branch can be fast-forwarded (that                                   
 +    # is the tip of the master branch can be updated to point to the tip of                                      
 +    # the topic branch) and this is what git does by default. With --no-ff                                       
 +    # option set git creates a real merge commit which records the fact that                                     
 +    # another branch was merged. I find this easier to understand and read in                                    
 +    # the log.                                                                                                   
 +    #mergeoptions = --no-commit --no-ff 
 +    mergeoptions = --no-ff 
  
 # Here comes a list of remote repositories that I frequently use. They are # Here comes a list of remote repositories that I frequently use. They are
Line 94: Line 120:
 # contain the same tag names (but pointing to different commit ids). # contain the same tag names (but pointing to different commit ids).
 [remote "sr"] [remote "sr"]
-        url = git://git.sip-router.org/sip-router +    url = git://git.sip-router.org/sip-router 
-        fetch = +refs/heads/*:refs/remotes/sr/+    fetch = +refs/heads/*:refs/remotes/sr/
-        fetch = refs/tags/*:refs/tags/sr/+    fetch = refs/tags/*:refs/tags/sr/
-        tagopt = --no-tags+    tagopt = --no-tags
  
 # This is the git import of the cvs repository of SER. See the description of # This is the git import of the cvs repository of SER. See the description of
Line 103: Line 129:
 # store them in a subdirectory. # store them in a subdirectory.
 [remote "cvs"] [remote "cvs"]
-        url = git://git.sip-router.org/ser +    url = git://git.sip-router.org/ser 
-        fetch = +refs/heads/*:refs/remotes/cvs/+    fetch = +refs/heads/*:refs/remotes/cvs/
-        fetch = refs/tags/*:refs/tags/cvs/+    fetch = refs/tags/*:refs/tags/cvs/
-        tagopt = --no-tags+    tagopt = --no-tags
  
 # This is the git import of the kamailio svn repository. This repository is # This is the git import of the kamailio svn repository. This repository is
Line 113: Line 139:
 # https transport. We are using unofficial CA certificates. # https transport. We are using unofficial CA certificates.
 [remote "km"] [remote "km"]
-        url = http://git.sip-router.org/kamailio +    url = http://git.sip-router.org/kamailio 
-        fetch = +refs/heads/*:refs/remotes/km/+    fetch = +refs/heads/*:refs/remotes/km/
-        fetch = refs/tags/*:refs/tags/km/+    fetch = refs/tags/*:refs/tags/km/
-        tagopt = --no-tags+    tagopt = --no-tags
  
 # This is the git import of the opensips svn repository. This repository is # This is the git import of the opensips svn repository. This repository is
Line 123: Line 149:
 # https transport. We are using unofficial CA certificates. # https transport. We are using unofficial CA certificates.
 [remote "os"] [remote "os"]
-        url = http://git.sip-router.org/opensips +    url = http://git.sip-router.org/opensips 
-        fetch = +refs/heads/*:refs/remotes/os/+    fetch = +refs/heads/*:refs/remotes/os/
-        fetch = refs/tags/*:refs/tags/os/+    fetch = refs/tags/*:refs/tags/os/
-        tagopt = --no-tags+    tagopt = --no-tags
 </code> </code>
 +
 +Some of the options were not so easy to figure out, so I decided to share the
 +config file to make your git learning curve less steep than mine was (and is
 +:-). The file is well commented.
 +
 +Save the configuration file in ''~/.gitconfig'' and set your name and email
 +address to your real name and real email address. After that you get your copy
 +of the sip-router repository using:
 +<code>
 +  mkdir my_repo
 +  cd my_repo
 +  git init
 +  git fetch sr
 +</code>
 +You have pulled the whole history when the last command finished. "sr" is a
 +shorthand for the sip-router git repository.
 +
 +As the next step you can check out the master branch, this is where the most
 +recent source code is (it is an equivalent of the trunk in svn or HEAD in cvs):
 +<code>
 +  git co -b master sr/master
 +</code>
 +"co" is an alias for checkout, this alias is defined in the configuration
 +file.
 +
 +So now you have your very own copy of the sip-router repository, but that's
 +not all, you can also pull the whole kamailio repository into it:
 +<code>
 +  g fetch km
 +</code>
 +"km" is a shorthand for the git mirror of the kamailio svn repository. This
 +command will produce a lot of output (don't be scared) and after it finishes
 +you will have the full history of both projects--sip-router and kamailio--in
 +your local git repository. You can, for example, check out kamailio svn trunk
 +using:
 +<code>
 +  git co -b kam_trunk km/trunk
 +</code>
 +And now you have the sources from kamailio trunk in your working directory.
 +
 +You can, of course do the same for SER from CVS, to get the latest sources of
 +ser:
 +<code>
 +  git fetch cvs
 +</code>
 +"cvs" is a shorthand for the git import of the ser cvs repository. Now you can
 +switch to cvs trunk using:
 +<code>
 +  git co -b cvs_trunk cvs/cvs-head
 +</code>
 +And now you have the latest ser sources in your working directory.
 +
 +And the last repository you can fetch from is the opensips git import:
 +<code>
 +  git fetch os
 +  git co -b opensips_trunk os/trunk
 +</code>
 +And you have the latest sources from opensips trunk.
 +
 +To display all branches from all repositories run:
 +<code>
 +  git branch -a
 +</code>
 +The most important branches are:
 +
 +  * ''sr/master''     - Latest version of sip-router core
 +  * ''cvs/cvs-head''  - Latest version of ser from cvs
 +  * ''km/trunk''      - Kamailio svn trunk
 +  * ''km/1.4''        - Kamailio branch with release 1.4
 +  * ''os/trunk''      - Opensips svn trunk
 +
  

Navigation

Wiki

Other

QR Code
QR Code git:gitconfig (generated for current page)