我正在和我的同事一起工作一个Android项目,他最近在上设置了一个GitHub仓库
似乎必须执行以下步骤
但是从这个线索
GitHub for Windows'同步做什么?
看起来'同步'按钮可以完成所有这三项操作吗?所以,我不确定如何准确地完成我的提交。我认为我已经进行了修改(在上一步中)的事实意味着我已经上演了它们,这就是为什么提供同步选项的原因。解决这个问题的任何帮助都将受到高度赞赏。
PS:我也向GitHub支持团队伸出援手,并在下面发布了他们的解决方案。
解决方案只要添加到VonC写的内容即可... b $ b
试图点击同步按钮,我看到以下屏幕:
阅读他的建议后,我点击'Open Shell'并键入
git stash并且显示如下
在此之后,我可以点击'同步'按钮并且可以同步成功。
阅读VonC的评论后添加
但是,在成功将该文件添加到回购后,我注意到另外两个构建文件('BuildConfig.java'和'project.properties')没有出现在Windows的GitHub中。因此,在阅读VonC的建议后,我输入了
git stash pop在之前打开的shell中,然后这两个文件再次出现在GitHub for Windows上。
从GitHub支持听回来后添加
不幸的是,当您将更改或文件分开时,您无法同步。但有一个解决方法:
当你同步时,本地提交将被提取并放到你从服务器获得的提交结束。
I'm working on an Android project with my colleague and he recently setup a GitHub repo on github. At my end, I downloaded and installed GitHub for Windows on my 64-bit Windows 7 machine. I then proceeded to go to the repo on GitHub and clone the project using the 'Clone in Windows' button.
Everything appeared to go smoothly and the project was at
C:\Android\git-repos\OurProjecton my machine. I then made some changes to the file
C:\Android\git-repos\OurProject\Host\Android\src\com\ourproject\client\SettingsActivity.javaI then observed that the changed file (along with some changed build files) did show up on the version of GitHub I had on my machine like this
I selected the 'SettingsActivity.java' file, filled in a short description and hit the 'Commit' button. Then I saw the following screen
Then, when I clicked on 'sync'
hoping the changes I made would be pushed back to the master repo, I got the following message
unstaged changes You cannot sync with unstaged changes. Please commit your changes and try again.Why did I get this error message?
I did look at this thread
What's the unstaged changes in github?
and it seems that one has to do the following steps
but from this thread
What does GitHub for Windows' "sync" do?
it might appear that the 'sync' button does all three? So, I'm not sure how to exactly stage my commits. I thought the fact that I had committed my changes (in the previous step) implied that I had staged them and that is why the option to sync was being offered. Any help in resolving this issue would be much-appreciated.
P.S: I also reached out to the GitHub support team and have posted their solution below as well.
解决方案Just to add to what VonC wrote...
Each time I attempted to hit the 'sync' button, I was shown the following screen
After reading what he suggested, I clicked on 'Open Shell' and typed
git stashand it displayed something like this
After this I was able to hit the 'sync' button and it was able to sync successfully.
Added After Reading VonC's Comment
However, after adding that file successfully to the repo, I noticed that the other two build files ('BuildConfig.java' and 'project.properties') were not showing up in GitHub for Windows. So, after reading VonC's suggestion, I typed
git stash popin the shell that was opened earlier and then the two files appeared again on GitHub for Windows.
Added After Hearing Back from GitHub Support
Unfortunately you can't sync while you have unstaged changes or files. But there is one workaround:
When you sync, local commits are taken and put at the end of the commits you got from the server.
更多推荐
将文件提交给GitHub for Windows
发布评论