GIT设置默认REMOTE地址方法

1. 如果你的GIT设置了多个remote地址,在不同的remote间pull方法为:

$ git pull <remote_name> <branch_name>

2. 每次都需要输入 remote name 和 branch name 比较麻烦,我们可以将某个remote 设置为默认

设置方法:

$ git config branch.master.remote <remote origin>

$ git config branch.master.merge refs/heads/master

3. 也可以直接通过修改git的配置文件进行设置。(工程所在.git目录)

$ vi .git/config

4. 如果需要对所有的项目都进行设置可以使用 --global 参数,进行设置。

猜你喜欢

转载自ideabean.iteye.com/blog/2072203