命令git中,“develop”和“origin/develop”的区别是什么?

8

我是一名新手,开始使用Git进行项目管理。 我没有注意到“Branch”和“origin/Branch”的区别。 请给我指导。 我面临的挑战的图片


2
develop是您电脑上的本地分支,而origin/develop是仓库中的一个分支。 - ΦXocę 웃 Пepeúpa ツ
`$ git branch develop developByMohammadEmad developByMohsen
  • developByMorteza master `
- Morteza M
$ git branch -r origin/develop origin/developByMohammadEmad origin/developByMohsen origin/developByMorteza origin/master - Morteza M
`$ git branch -a develop developByMohammadEmad developByMohsen
  • developByMorteza master remotes/origin/develop remotes/origin/developByMohammadEmad remotes/origin/developByMohsen remotes/origin/developByMorteza remotes/origin/master`
- Morteza M
1
当你刚接触 git 时,最重要的事情就是学习 git。你应该去阅读《Pro Git》(https://git-scm.com/book/zh/v2) 这本书,并且参考不同的教程(https://try.github.io/levels/1/challenges/1,http://rogerdudler.github.io/git-guide/,https://www.atlassian.com/git/tutorials,https://git-scm.com/docs/gittutorial)。 - Lasse V. Karlsen
1个回答

11

Branch 是你的本地分支,origin/Branch 是你的远程分支。

为确保哪些分支是本地的还是远程的,请使用以下 Git 命令。

$ git branch     # see local branches
$ git branch -r  # see remote branches
$ git branch -a  # see local and remote branches

何时应该使用 $git push origin/develop,以及何时应该使用 $git push develop - Morteza M
你从不直接向本地分支 push,而是通过 commitpull 来更新它(简化版)。 - choroba
我理解你的意思 但是 那么为什么会有这个命令呢? - Morteza M
这些命令有助于确定分支是本地还是远程。 - Sajib Khan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接