Git Push澄清 - 推动什么? [英] Git Push clarification - What gets pushed?

查看:121
本文介绍了Git Push澄清 - 推动什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我推送本地工作时目录到中央存储库,执行所有中间分支并提交信息(从上次推送到这个)推入?

换句话说, 推送会产生确切我的当前工作目录的整个历史的副本,包括提交,分支等,因此可供其他用户从中央存储库中提取?



如果不是所有东西都被推了,什么被排除了?

解决方案

当你运行 git push ,你可以设置在命令行上推送的内容。例如,这个

  git push origin my-branch:fooo 

将分支my-branch从本地存储库推送到origin分支fooo。

当你在没有任何参数的情况下运行 git push 时,它会推送到你当前分支的远程设置(你可以通过 git config branch。并且在 push.default 配置值中进行配置,根据 kernel.org/pub/software/scm/git/docs/v1.7.10.1/git-config.htmlrel =nofollow> docs ,可以是以下之一:




  • nothing - 不要推送任何内容
  • 匹配 - 推送所有匹配的分支。所有在两端具有相同名称的分支都被认为是匹配的。这是默认值。

  • 上游 - 将当前分支推送到其上游分支。

  • 跟踪 - 不赞成使用上游同义词。 > 分支到同名分支。


When I push a local working directory to a central repository, do all intermediate branches and commit information (from last push to this one) get pushed?

In other words, does push produce an exact replica of the entire history of my current working directory, including commits, branches, etc., and thus are made available to any other user pulling from the central repository?

If not everything is pushed, what gets excluded?

解决方案

When you run git push, you can set what gets pushed on the command line. For example, this

git push origin my-branch:fooo

pushes branch "my-branch" from your local repository to branch "fooo" at "origin".

When you run git push without any arguments, it pushes to remote set for your current branch (you can see that by git config branch.<branchname>.remote) and does what is configured in push.default configuration value, which, according to docs, can be one of the following:

  • nothing - do not push anything.
  • matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
  • upstream - push the current branch to its upstream branch.
  • tracking - deprecated synonym for upstream.
  • current - push the current branch to a branch of the same name.

这篇关于Git Push澄清 - 推动什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆