Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
git:gitconfig [2009/02/16 21:20] janakj created |
git:gitconfig [2009/04/16 17:25] (current) 212.227.35.68 |
||
---|---|---|---|
Line 10: | Line 10: | ||
< | < | ||
[user] | [user] | ||
- | | + | |
- | email = <your email address> | + | email = <your email address> |
[core] | [core] | ||
- | | + | |
- | # produced by emacs and they hold the original version of the file | + | # The file below contains a list of patterns to match Emacs backup |
- | # retrieved from the vcs. | + | # temporary files (note that you need to provide full path to the file |
- | excludesfile = *~ | + | # because git would not expand ~). Uncomment |
+ | # want to use a global .gitignore file. | ||
+ | #excludesfile = / | ||
[format] | [format] | ||
- | | + | |
- | # 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] | ||
- | | + | |
- | # 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/ | + | # and store the packed references in .git/ |
- | # 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] | ||
- | | + | |
- | # 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 |
- | | + | |
- | # 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] | ||
- | | + | |
- | 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] | ||
- | | + | |
- | diff = auto | + | diff = auto |
- | status = auto | + | status = auto |
[http] | [http] | ||
- | | + | |
- | # is useful if you pull from, for example, https:// | + | # is useful if you pull from, for example, https:// |
- | sslCAInfo = / | + | # Uncomment the following configuration option if you have the CA certificate |
+ | # installed. | ||
+ | #sslCAInfo = / | ||
[merge] | [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 |
- | | + | |
- | stat = true | + | stat = true |
[branch] | [branch] | ||
- | | + | |
- | # 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 " | ||
+ | # 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. | ||
+ | # | ||
# 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 91: | Line 119: | ||
# contain the same tag names (but pointing to different commit ids). | # contain the same tag names (but pointing to different commit ids). | ||
[remote " | [remote " | ||
- | | + | |
- | fetch = +refs/ | + | fetch = +refs/ |
- | fetch = refs/ | + | fetch = refs/ |
- | 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 100: | Line 128: | ||
# store them in a subdirectory. | # store them in a subdirectory. | ||
[remote " | [remote " | ||
- | | + | |
- | fetch = +refs/ | + | fetch = +refs/ |
- | fetch = refs/ | + | fetch = refs/ |
- | 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 110: | Line 138: | ||
# https transport. We are using unofficial CA certificates. | # https transport. We are using unofficial CA certificates. | ||
[remote " | [remote " | ||
- | | + | |
- | fetch = +refs/ | + | fetch = +refs/ |
- | fetch = refs/ | + | fetch = refs/ |
- | 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 120: | Line 148: | ||
# https transport. We are using unofficial CA certificates. | # https transport. We are using unofficial CA certificates. | ||
[remote " | [remote " | ||
- | | + | |
- | fetch = +refs/ | + | fetch = +refs/ |
- | fetch = refs/ | + | fetch = refs/ |
- | tagopt = --no-tags | + | tagopt = --no-tags |
</ | </ | ||
+ | |||
+ | 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 '' | ||
+ | address to your real name and real email address. After that you get your copy | ||
+ | of the sip-router repository using: | ||
+ | < | ||
+ | mkdir my_repo | ||
+ | cd my_repo | ||
+ | git init | ||
+ | git fetch sr | ||
+ | </ | ||
+ | You have pulled the whole history when the last command finished. " | ||
+ | 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): | ||
+ | < | ||
+ | git co -b master sr/master | ||
+ | </ | ||
+ | " | ||
+ | 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: | ||
+ | < | ||
+ | g fetch km | ||
+ | </ | ||
+ | " | ||
+ | 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: | ||
+ | < | ||
+ | git co -b kam_trunk km/trunk | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | git fetch cvs | ||
+ | </ | ||
+ | " | ||
+ | switch to cvs trunk using: | ||
+ | < | ||
+ | git co -b cvs_trunk cvs/ | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | git fetch os | ||
+ | git co -b opensips_trunk os/trunk | ||
+ | </ | ||
+ | And you have the latest sources from opensips trunk. | ||
+ | |||
+ | To display all branches from all repositories run: | ||
+ | < | ||
+ | git branch -a | ||
+ | </ | ||
+ | The most important branches are: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||