相关疑难解决方法(0)

警告:push.default未设置; 它的隐含值在Git 2.0中发生了变化

我一直在使用Git一段时间,并且最近只下载了一个更新,以便在我尝试时发现此警告消息push.

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use: 

  git config --global push.default simple
Run Code Online (Sandbox Code Playgroud)

我显然可以将它设置为所提到的值之一,但它们是什么意思?simple和之间有什么区别matching

如果我在一个客户端上更改它,我是否需要在我共享回购的其他客户端上做任何事情?

git version-control

1615
推荐指数
3
解决办法
25万
查看次数

没有指定分支的"git push"的默认行为

我使用以下命令推送到我的远程分支:

git push origin sandbox
Run Code Online (Sandbox Code Playgroud)

如果我说

git push origin
Run Code Online (Sandbox Code Playgroud)

这会推动我的其他分支的变化,还是只更新我当前的分支?我有三个分支:master,productionsandbox.

git push文件是不是这个很清楚,所以我想澄清这一点为好.

哪些分支和遥控器可以git push完全更新以下命令?

git push 
git push origin
Run Code Online (Sandbox Code Playgroud)

origin 上面是一个遥控器.

据我所知,git push [remote] [branch]只会将该分支推送到远程.

git branch git-push git-branch

1339
推荐指数
10
解决办法
62万
查看次数

`git config`和`git push --set-upstream`之间有什么区别?

有什么区别:

$ git remote add origin git@github.com:yourname/yourproject.git
$ git config remote.origin.push refs/heads/master:refs/heads/master
$ git push
Run Code Online (Sandbox Code Playgroud)

和:

$ git remote add origin git@github.com:yourname/yourproject.git
$ git push origin master -u
Run Code Online (Sandbox Code Playgroud)

第二个版本是否比第一个版本更新更短,还是有其他差异?

背景研究

从Git 1.7.0开始,您可以使用该--set-upstream选项git push.根据git push手册:

-u, --set-upstream
    For every branch that is up to date or successfully pushed, add upstream
    (tracking) reference, used by argument-less git-pull(1) and other commands. For
    more information, see branch.<name>.merge in git-config(1).
Run Code Online (Sandbox Code Playgroud)

git git-push git-config

2
推荐指数
1
解决办法
3143
查看次数

标签 统计

git ×3

git-push ×2

branch ×1

git-branch ×1

git-config ×1

version-control ×1