@@ -2856,48 +2856,34 @@ branch.master.merge=refs/heads/master
2856
2856
2857
2857
If there are other repositories that you also use frequently, you can
2858
2858
create similar configuration options to save typing; for example,
2859
- after
2860
2859
2861
2860
-------------------------------------------------
2862
- $ git config remote. example.url git://example.com/proj.git
2861
+ $ git remote add example git://example.com/proj.git
2863
2862
-------------------------------------------------
2864
2863
2865
- then the following two commands will do the same thing :
2864
+ adds the following to `.git/config` :
2866
2865
2867
2866
-------------------------------------------------
2868
- $ git fetch git://example.com/proj.git master:refs/remotes/example/master
2869
- $ git fetch example master:refs/remotes/example/master
2867
+ [remote "example"]
2868
+ url = git://example.com/proj.git
2869
+ fetch = +refs/heads/*:refs/remotes/example/*
2870
2870
-------------------------------------------------
2871
2871
2872
- Even better, if you add one more option:
2873
-
2874
- -------------------------------------------------
2875
- $ git config remote.example.fetch master:refs/remotes/example/master
2876
- -------------------------------------------------
2872
+ Also note that the above configuration can be performed by directly
2873
+ editing the file `.git/config` instead of using linkgit:git-remote[1].
2877
2874
2878
- then the following commands will all do the same thing:
2875
+ After configuring the remote, the following three commands will do the
2876
+ same thing:
2879
2877
2880
2878
-------------------------------------------------
2881
- $ git fetch git://example.com/proj.git master :refs/remotes/example/master
2882
- $ git fetch example master :refs/remotes/example/master
2879
+ $ git fetch git://example.com/proj.git +refs/heads/* :refs/remotes/example/*
2880
+ $ git fetch example +refs/heads/* :refs/remotes/example/*
2883
2881
$ git fetch example
2884
2882
-------------------------------------------------
2885
2883
2886
- You can also add a "+" to force the update each time:
2887
-
2888
- -------------------------------------------------
2889
- $ git config remote.example.fetch +master:refs/remotes/example/master
2890
- -------------------------------------------------
2891
-
2892
- Don't do this unless you're sure you won't mind "git fetch" possibly
2893
- throwing away commits on 'example/master'.
2894
-
2895
- Also note that all of the above configuration can be performed by
2896
- directly editing the file .git/config instead of using
2897
- linkgit:git-config[1].
2898
-
2899
2884
See linkgit:git-config[1] for more details on the configuration
2900
- options mentioned above.
2885
+ options mentioned above and linkgit:git-fetch[1] for more details on
2886
+ the refspec syntax.
2901
2887
2902
2888
2903
2889
[[git-concepts]]
0 commit comments