简体   繁体   中英

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)

I noticed that a project I'm working on locally, is not updating the remote github repository. In fact github thinks I last committed 1 year ago.

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)

I ran git log and it gave me the following (just the top is included):

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

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

如评论之一所述,您的提交可能在这里: https : //github.com/charcode/StockScreener/tree/persistence

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM