草庐IT

Git 分支 : master vs. origin/master 与 remotes/origin/master

我认为我在理解git的基本概念方面是正确的。我已经设置并克隆了一个远程存储库。我还创建了一个服务器端空存储库,并将我的本地存储库链接到它。我的问题是我不明白:origin/master与remotes/origin/master据我了解,ma​​ster是本地分支,remotes/origin/master是远程分支。但是origin/master到底是什么? 最佳答案 获取远程存储库的克隆并运行gitbranch-a(以显示git知道的所有分支)。它可能看起来像这样:*masterremotes/origin/HEAD->orig

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)

git - 什么是 "git remote add ..."和 "git push origin master"?

经常,Git和RubyonRails看起来很神奇......比如在firstchapterofRubyonRails3Tutorialbook,它谈到了Git:gitremoteaddorigingit@github.com:peter/first_app.gitgitpushoriginmaster它几乎是在说“它只是有效”,但没有过多说明它们是什么,而是开始谈论分支。在网上查了一下,gitremoteadd是加一个“简称”,比如origin,也可以是任意的名字,就像别名一样到一个URL。origin是远程存储库指向的通常路径(在“添加远程存储库”下的http://git-scm.c

git - 什么是 "git remote add ..."和 "git push origin master"?

经常,Git和RubyonRails看起来很神奇......比如在firstchapterofRubyonRails3Tutorialbook,它谈到了Git:gitremoteaddorigingit@github.com:peter/first_app.gitgitpushoriginmaster它几乎是在说“它只是有效”,但没有过多说明它们是什么,而是开始谈论分支。在网上查了一下,gitremoteadd是加一个“简称”,比如origin,也可以是任意的名字,就像别名一样到一个URL。origin是远程存储库指向的通常路径(在“添加远程存储库”下的http://git-scm.c

git - "u"到底做了什么? "git push -u origin master"与 "git push origin master"

尽管我尽了最大努力去理解它,但我显然不擅长使用git。来自kernel.org对于gitpush:-u--set-upstreamForeverybranchthatisuptodateorsuccessfullypushed,addupstream(tracking)reference,usedbyargument-lessgit-pull(1)andothercommands.Formoreinformation,seebranch..mergeingit-config(1).这是branch..merge来自gitconfig:branch..mergeDefines,toget

git - "u"到底做了什么? "git push -u origin master"与 "git push origin master"

尽管我尽了最大努力去理解它,但我显然不擅长使用git。来自kernel.org对于gitpush:-u--set-upstreamForeverybranchthatisuptodateorsuccessfullypushed,addupstream(tracking)reference,usedbyargument-lessgit-pull(1)andothercommands.Formoreinformation,seebranch..mergeingit-config(1).这是branch..merge来自gitconfig:branch..mergeDefines,toget

git - git remote prune、git prune、git fetch --prune 等之间有什么区别

我的情况是这样的......在同一个仓库工作的人已经从他的本地和远程仓库中删除了一个分支......大多数在StackOverflow或其他网站上询问过此类问题的人都有分支问题仍然显示在他们的远程跟踪分支列表gitbranch-a底部:*masterdevelopfeature_blahremotes/origin/masterremotes/origin/developremotes/origin/feature_blahremotes/origin/random_branch_I_want_deleted然而,在我的情况下,不应该存在的分支是本地的:*masterdevelopfe

git - git remote prune、git prune、git fetch --prune 等之间有什么区别

我的情况是这样的......在同一个仓库工作的人已经从他的本地和远程仓库中删除了一个分支......大多数在StackOverflow或其他网站上询问过此类问题的人都有分支问题仍然显示在他们的远程跟踪分支列表gitbranch-a底部:*masterdevelopfeature_blahremotes/origin/masterremotes/origin/developremotes/origin/feature_blahremotes/origin/random_branch_I_want_deleted然而,在我的情况下,不应该存在的分支是本地的:*masterdevelopfe

git - 如何运行 git log 以仅查看特定分支的更改?

我有一个本地分支跟踪远程/主分支。运行git-pull和git-log后,日志将显示远程跟踪分支以及当前分支中的所有提交。但是,由于对远程分支进行了太多更改,我只需要查看对当前本地分支所做的提交。仅显示特定分支的提交的Git命令是什么?注意事项:配置信息:[branch"my-branch"]remote=originmerge=refs/heads/master 最佳答案 假设您的分支是从master创建的,然后在分支中(也就是说,您已checkout分支):gitcherry-vmaster或gitlogmaster..如果你不