[英]Git not synchronizing local branch to github repository
I'm still newbie on git, I've used SVN for most of my working life (10+years) 我仍然是git的新手,在我的大部分工作时间(超过10年)中都使用SVN
I noticed that a project I'm working on locally, is not updating the remote github repository. 我注意到我在本地工作的一个项目没有更新远程github存储库。 In fact github thinks I last committed 1 year ago.
实际上,github认为我上次承诺是在一年前。
locally I commit and push regularly and I never been checking the remote repository. 我在本地定期提交和推送,但从未检查过远程存储库。
what happened is probably a year or so ago, I decided to create a branch to work on an extension of my project, but this seems to have created a local repository on my machine and every commit/push is actually staying local. 发生的情况大概是一年左右,我决定创建一个分支来处理项目的扩展,但是这似乎已经在我的计算机上创建了本地存储库,并且每次提交/推送实际上都保持本地状态。 That is my thinking but I may be wrong.
那是我的想法,但我可能错了。
I ran the command: 我运行了命令:
git remote show origin
The output is as follows: 输出如下:
C:\Users\charb\git\StockScreener-persistence [persistence ≡ +1 ~0 -0 !]> git remote show origin
* remote origin
Fetch URL: https://github.com/charcode/StockScreener.git
Push URL: https://github.com/charcode/StockScreener.git
HEAD branch: master
Remote branches:
adding_persistence tracked
master new (next fetch will store in remotes/origin)
persistence tracked
reducing_barrier new (next fetch will store in remotes/origin)
Local branches configured for 'git pull':
adding_persistence merges with remote adding_persistence
persistence merges with remote persistence
Local refs configured for 'git push':
adding_persistence pushes to adding_persistence (local out of date)
persistence pushes to persistence (up to date)
C:\Users\charb\git\StockScreener-persistence [persistence ≡ +1 ~0 -0 !]>
persistence is a branch that I created today in an attempt to commit the code to a branch remotely (on github) 持久性是我今天创建的一个分支,试图将代码远程提交给分支(在github上)
I ran git log
and it gave me the following (just the top is included): 我运行了
git log
,它给了我以下内容(仅包括顶部):
commit b7732f31dc86f55c2f822d8a514d7726ac32a70f
Author: charcode <charbelgereige@gmail.com>
Date: Wed Oct 19 01:11:48 2016 +0100
most of the first step of DB persistence for symbols and sectors done.
something still not working in the @Autowired repositories
commit c308d1fbb7ed0b11043a865cc60014e9ca5ccc69
Author: charcode <charbelgereige@gmail.com>
Date: Sun Oct 16 09:01:00 2016 +0100
If you go on the repository on github, it says last commit Nov 2015: https://github.com/charbelgereige/StockFilter/commits/persistence 如果您使用github上的存储库,它说的是2015年11月的最后一次提交: https : //github.com/charbelgereige/StockFilter/commits/persistence
And I don't see my recent changes (for the last year!! - luckily I have them locally) Any ideas? 而且我没有看到我最近的变化(去年!!-幸运的是我在本地拥有它们)有什么想法吗?
Try this (to add your remote again): 尝试以下操作(再次添加您的遥控器):
git remote remove origin
git remote add origin git@github.com:charbelgereige/StockFilter.git
And then try to push
again 然后尝试再次
push
如评论之一所述,您的提交可能在这里: https : //github.com/charcode/StockScreener/tree/persistence ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.