草庐IT

other_branch

全部标签

git - "git branch"和 "git checkout -b"有什么区别?

我使用gitcheckout-b创建了一个新分支。我认为gitbranch做同样的事情。如果这两个命令完全不同,它们有何不同? 最佳答案 gitcheckout-bBRANCH_NAME创建一个新分支并checkout新分支,而gitbranchBRANCH_NAME创建一个新分支但将您留在同一分支上。换句话说,gitcheckout-bBRANCH_NAME为您执行以下操作。gitbranchBRANCH_NAME#createanewbranchgitswitchBRANCH_NAME#thenswitchtothenewbra

git - "git branch"和 "git checkout -b"有什么区别?

我使用gitcheckout-b创建了一个新分支。我认为gitbranch做同样的事情。如果这两个命令完全不同,它们有何不同? 最佳答案 gitcheckout-bBRANCH_NAME创建一个新分支并checkout新分支,而gitbranchBRANCH_NAME创建一个新分支但将您留在同一分支上。换句话说,gitcheckout-bBRANCH_NAME为您执行以下操作。gitbranchBRANCH_NAME#createanewbranchgitswitchBRANCH_NAME#thenswitchtothenewbra

git - 致命的 : The current branch master has no upstream branch

我正在尝试将我的一个项目推送到github,但我一直收到此错误:peeplesoft@jane3:~/846156(master)$gitpushfatal:Thecurrentbranchmasterhasnoupstreambranch.Topushthecurrentbranchandsettheremoteasupstream,usegitpush--set-upstreamoriginmaster所以我试了一下,得到了这个:peeplesoft@jane3:~/846156(master)$gitpush--set-upstreamoriginmasterfatal:Auth

git - 致命的 : The current branch master has no upstream branch

我正在尝试将我的一个项目推送到github,但我一直收到此错误:peeplesoft@jane3:~/846156(master)$gitpushfatal:Thecurrentbranchmasterhasnoupstreambranch.Topushthecurrentbranchandsettheremoteasupstream,usegitpush--set-upstreamoriginmaster所以我试了一下,得到了这个:peeplesoft@jane3:~/846156(master)$gitpush--set-upstreamoriginmasterfatal:Auth

git - git checkout --track origin/branch 和 git checkout -b branch origin/branch 的区别

有人知道这两个切换和跟踪远程分支的命令之间的区别吗?gitcheckout-bbranchorigin/branchgitcheckout--trackorigin/branch我想两者都会跟踪远程分支,这样我就可以将我的更改推送到原始分支,对吧?有什么实际差异吗? 最佳答案 这两个命令具有相同的效果(thankstoRobertSiemer’sanswerforpointingitout)。当使用名为不同的本地分支时,实际的区别就来了:gitcheckout-bmybranchorigin/abranch将创建mybranch和跟

git - git checkout --track origin/branch 和 git checkout -b branch origin/branch 的区别

有人知道这两个切换和跟踪远程分支的命令之间的区别吗?gitcheckout-bbranchorigin/branchgitcheckout--trackorigin/branch我想两者都会跟踪远程分支,这样我就可以将我的更改推送到原始分支,对吧?有什么实际差异吗? 最佳答案 这两个命令具有相同的效果(thankstoRobertSiemer’sanswerforpointingitout)。当使用名为不同的本地分支时,实际的区别就来了:gitcheckout-bmybranchorigin/abranch将创建mybranch和跟

git - "Cannot update paths and switch to branch at the same time"

我有时会使用checkout-b选项来创建一个新分支,同时检查它并在一个命令中设置跟踪。在新环境中,我得到这个错误:$gitcheckout-btest--trackorigin/masterfatal:Cannotupdatepathsandswitchtobranch'test'atthesametime.Didyouintendtocheckout'origin/master'whichcannotberesolvedascommit?为什么Git不喜欢它?这曾经与同一个仓库一起工作。 最佳答案 'origin/master'

git - "Cannot update paths and switch to branch at the same time"

我有时会使用checkout-b选项来创建一个新分支,同时检查它并在一个命令中设置跟踪。在新环境中,我得到这个错误:$gitcheckout-btest--trackorigin/masterfatal:Cannotupdatepathsandswitchtobranch'test'atthesametime.Didyouintendtocheckout'origin/master'whichcannotberesolvedascommit?为什么Git不喜欢它?这曾经与同一个仓库一起工作。 最佳答案 'origin/master'

git - 当上游存在更改时,为什么 git status show branch 是最新的?

更改存在于跟踪分支的上游,但是当我键入gitstatus时,它表明我的本地分支是最新的。这是新行为,我是否更改了配置设置,还是出了什么问题?感谢您的帮助。ubuntu@host:/my/repo#gitstatusOnbranchmasterYourbranchisup-to-datewith'origin/master'.nothingtocommit,workingdirectorycleanubuntu@host:/my/repo#gitpullremote:Countingobjects:11,done.remote:Compressingobjects:100%(11/11)

git - 当上游存在更改时,为什么 git status show branch 是最新的?

更改存在于跟踪分支的上游,但是当我键入gitstatus时,它表明我的本地分支是最新的。这是新行为,我是否更改了配置设置,还是出了什么问题?感谢您的帮助。ubuntu@host:/my/repo#gitstatusOnbranchmasterYourbranchisup-to-datewith'origin/master'.nothingtocommit,workingdirectorycleanubuntu@host:/my/repo#gitpullremote:Countingobjects:11,done.remote:Compressingobjects:100%(11/11)