设置git pull的默认地址

git pull origin master

当git clone之后,直接git pull它会自动匹配一个正确的remote url

是因为在config文件中配置了以下内容:

1 [branch " master " ]
2 remote = origin
3 merge = refs / heads / master

在参考[2]中,有这样一段:

Note: at this point your repository is not setup to merge _from_ the remote branch when you type 'git pull'. You can either freshly 'clone' the repository (see "Developer checkout" below), or configure your current repository this way:

1 git remote add - f origin login@git.sv.gnu.org: / srv / git / project.git
2 git config branch.master.remote origin
3 git config branch.master.merge refs / heads / master    

 

因此通过git config进行如下配置:

1 $ git config branch.master.remote origin
2 $ git config branch.master.merge refs / heads / master

或者加上--global选项,对于全部项目都使用该配置。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值