[英]git fetch don't load latest version of the project
I have my project on two computers and I want to download all changes from computer 1 to computer 2 . 我的项目在两台计算机上,我想将所有更改从计算机1下载到计算机2 。 I use
git fetch --all
for it, but it don't load all the changes. 我使用
git fetch --all
来实现,但是它不会加载所有更改。 I make commit every day on computer 1 and on computer 2 github says, that the last commit was made 5 days ago. 我每天在计算机1和2上进行提交,github上说,上一次提交是在5天前进行的。 What is wrong?
怎么了?
Edit 1 编辑1
If you have to push the code to upstream(github/bitbucket repo) from computer1, it will available there. 如果您必须将代码从computer1推送到上游(github / bitbucket存储库),它将在那里可用。
we use git push <remote name> <branch name>
我们使用
git push <remote name> <branch name>
You already have remote name : origin so use it 您已经有远程名称:origin,所以请使用它
From upstream you need to get that data. 从上游,您需要获取该数据。
So normal we clone it first, or get add a remote to pull the code. 因此,正常情况下,我们首先克隆它,或者添加一个遥控器来提取代码。
In your case, instead of git fetch
you need git pull upstream master
,so that the code will be fetch and merged too. 在您的情况下,您需要
git pull upstream master
来代替git fetch
,这样代码也将被获取并合并。
And it shows you don't have proper access to the repo to push as you misplace remote at git push. 它表明您在git push上放错远程位置时,没有适当的访问权限来回购推送。 Even remote is consider as a name here.
这里甚至将remote视为一个名称。 so use your remote name which is display on git remote -v
因此,请使用显示在git remote -v上的远程名称
Remote has a name ,so use git push origin master to push the code 远程有一个名字,所以使用git push origin master来推送代码
git status
, git remote -v
和 git push origin master
从已提交更改的计算机上执行这些操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.