@@ -931,11 +931,20 @@ The linkgit:git-archive[1] command can create a tar or zip archive from
931931any version of a project; for example:
932932
933933-------------------------------------------------
934- $ git archive --format= tar --prefix=project/ HEAD | gzip >latest.tar.gz
934+ $ git archive -o latest. tar.gz --prefix=project/ HEAD
935935-------------------------------------------------
936936
937- will use HEAD to produce a tar archive in which each filename is
938- preceded by "project/".
937+ will use HEAD to produce a gzipped tar archive in which each filename
938+ is preceded by `project/`. The output file format is inferred from
939+ the output file extension if possible, see linkgit:git-archive[1] for
940+ details.
941+
942+ Versions of Git older than 1.7.7 don't know about the 'tar.gz' format,
943+ you'll need to use gzip explicitly:
944+
945+ -------------------------------------------------
946+ $ git archive --format=tar --prefix=project/ HEAD | gzip >latest.tar.gz
947+ -------------------------------------------------
939948
940949If you're releasing a new version of a software project, you may want
941950to simultaneously make a changelog to include in the release
@@ -991,18 +1000,26 @@ Developing with Git
9911000Telling Git your name
9921001---------------------
9931002
994- Before creating any commits, you should introduce yourself to Git. The
995- easiest way to do so is to make sure the following lines appear in a
996- file named .gitconfig in your home directory:
1003+ Before creating any commits, you should introduce yourself to Git.
1004+ The easiest way to do so is to use linkgit:git-config[1]:
1005+
1006+ ------------------------------------------------
1007+ $ git config --global user.name 'Your Name Comes Here'
1008+ $ git config --global user.email '
[email protected] '
1009+ ------------------------------------------------
1010+
1011+ Which will add the following to a file named `.gitconfig` in your
1012+ home directory:
9971013
9981014------------------------------------------------
9991015[user]
10001016 name = Your Name Comes Here
1001101710021018------------------------------------------------
10031019
1004- (See the "CONFIGURATION FILE" section of linkgit:git-config[1] for
1005- details on the configuration file.)
1020+ See the "CONFIGURATION FILE" section of linkgit:git-config[1] for
1021+ details on the configuration file. The file is plain text, so you can
1022+ also edit it with your favorite editor.
10061023
10071024
10081025[[creating-a-new-repository]]
@@ -1993,16 +2010,21 @@ See the description ofthe receive.denyCurrentBranch option
19932010in linkgit:git-config[1] for details.
19942011
19952012As with `git fetch`, you may also set up configuration options to
1996- save typing; so, for example, after
2013+ save typing; so, for example:
2014+
2015+ -------------------------------------------------
2016+ $ git remote add public-repo ssh://yourserver.com/~you/proj.git
2017+ -------------------------------------------------
2018+
2019+ adds the following to `.git/config`:
19972020
19982021-------------------------------------------------
1999- $ cat >>.git/config <<EOF
20002022[remote "public-repo"]
2001- url = ssh:// yourserver.com/~you/ proj.git
2002- EOF
2023+ url = yourserver.com: proj.git
2024+ fetch = +refs/heads/*:refs/remotes/example/*
20032025-------------------------------------------------
20042026
2005- you should be able to perform the above push with just
2027+ which lets you do the same push with just
20062028
20072029-------------------------------------------------
20082030$ git push public-repo master
@@ -2041,6 +2063,13 @@ branch name with a plus sign:
20412063$ git push ssh://yourserver.com/~you/proj.git +master
20422064-------------------------------------------------
20432065
2066+ Note the addition of the `+` sign. Alternatively, you can use the
2067+ `-f` flag to force the remote update, as in:
2068+
2069+ -------------------------------------------------
2070+ $ git push -f ssh://yourserver.com/~you/proj.git master
2071+ -------------------------------------------------
2072+
20442073Normally whenever a branch head in a public repository is modified, it
20452074is modified to point to a descendant of the commit that it pointed to
20462075before. By forcing a push in this situation, you break that convention.
@@ -2845,48 +2874,34 @@ branch.master.merge=refs/heads/master
28452874
28462875If there are other repositories that you also use frequently, you can
28472876create similar configuration options to save typing; for example,
2848- after
28492877
28502878-------------------------------------------------
2851- $ git config remote. example.url git://example.com/proj.git
2879+ $ git remote add example git://example.com/proj.git
28522880-------------------------------------------------
28532881
2854- then the following two commands will do the same thing :
2882+ adds the following to `.git/config` :
28552883
28562884-------------------------------------------------
2857- $ git fetch git://example.com/proj.git master:refs/remotes/example/master
2858- $ git fetch example master:refs/remotes/example/master
2885+ [remote "example"]
2886+ url = git://example.com/proj.git
2887+ fetch = +refs/heads/*:refs/remotes/example/*
28592888-------------------------------------------------
28602889
2861- Even better, if you add one more option:
2862-
2863- -------------------------------------------------
2864- $ git config remote.example.fetch master:refs/remotes/example/master
2865- -------------------------------------------------
2890+ Also note that the above configuration can be performed by directly
2891+ editing the file `.git/config` instead of using linkgit:git-remote[1].
28662892
2867- then the following commands will all do the same thing:
2893+ After configuring the remote, the following three commands will do the
2894+ same thing:
28682895
28692896-------------------------------------------------
2870- $ git fetch git://example.com/proj.git master :refs/remotes/example/master
2871- $ git fetch example master :refs/remotes/example/master
2897+ $ git fetch git://example.com/proj.git +refs/heads/* :refs/remotes/example/*
2898+ $ git fetch example +refs/heads/* :refs/remotes/example/*
28722899$ git fetch example
28732900-------------------------------------------------
28742901
2875- You can also add a "+" to force the update each time:
2876-
2877- -------------------------------------------------
2878- $ git config remote.example.fetch +master:refs/remotes/example/master
2879- -------------------------------------------------
2880-
2881- Don't do this unless you're sure you won't mind "git fetch" possibly
2882- throwing away commits on 'example/master'.
2883-
2884- Also note that all of the above configuration can be performed by
2885- directly editing the file .git/config instead of using
2886- linkgit:git-config[1].
2887-
28882902See linkgit:git-config[1] for more details on the configuration
2889- options mentioned above.
2903+ options mentioned above and linkgit:git-fetch[1] for more details on
2904+ the refspec syntax.
28902905
28912906
28922907[[git-concepts]]
0 commit comments