本文介绍了指定远程的git分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在这个论坛寻求帮助,我发现了一些关于 .git / config 文件的评论,但是我的看起来已经很好了(至少对我来说): [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [远程起源] fetch = + refs / heads / *:refs / remotes / origin / * url = [email protected]:sigbackup / gsapp.git [branch' master] remote = origin merge = refs / heads / master [branchorigin] remote = origin merge = refs / heads / master 我错过了什么吗? 任何想法如何解决它? PS我也试过 git pull origin [email protected]:sigbackup / gsapp。 git 和我得到了 解决方案您签出了哪些本地分行? $ git status 显示? 您可能正在研究除本地主分支之外的其他分支。如果你想从github获取新的提交并将它们合并到本地主分支,你必须: git checkout master git pull 如果你想在你工作的分支上进行那些提交,需要: git pull origin master 您在PS中尝试过,但最后一个参数应该是分支名称,而不是回购网址。 b 您也可以从github中获取新的提交,并且不要将它合并到任何本地分支中: git fetch origin 然后用 git diff , git log 等等,然后稍后合并到当前签出的分支中: git merge origin / master I'm trying to update my webbynode pulling from github but I got the message below:So I have checked out this forum for help and I found some comments regarding .git/config file but mine looks already fine (at least to me):[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true[remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = [email protected]:sigbackup/gsapp.git[branch "master"] remote = origin merge = refs/heads/master[branch "origin"] remote = origin merge = refs/heads/masterAm I missing something?Any ideas how I can solve it?PS I also tried git pull origin [email protected]:sigbackup/gsapp.git and I got 解决方案 What local branch have you checked out?What git status shows?You are probably working on some other branch than the local master branch. If you want to fetch new commits from github and merge them to the local master branch, you have to:git checkout mastergit pullIf you want those commits in the branch, on which you are working, you need:git pull origin masterYou were close in your try from PS, but the last param should be branch name, not the repo url.You can also just fetch new commits from github, and do not merge it into any local branch, with:git fetch originThen review those changes with git diff, git log, etc, and merge later to the currently checked out branch with:git merge origin/master 这篇关于指定远程的git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-04 20:53