I have a git repository with more than 1350 commits and several branches. Every time I want to pull some changes from Github, I get stuck in a situation that a bunch of files are modified but they aren't. They are always the same and I can discard those "changes" until I run both "git checkout" and "git reset" commands random times in different order.
Anybody have a clue about what is going on? Could the size of the repository? if it is, is there anything I can do in order to reduce the size like deleting old commits or something similar?
Any help would be appreciated.
Regards
Edit:
This issue also happens when I pull from master. This is how I reproduce this issue:
This issue happen randomly even if my co-workers using the same OS as me (I'm using Ubuntu).
A bunch of files have been modified is surely caused by the out-sync, in other word, commit histories are different between local repository and remote on GitHub. Before pull from remote, you need to verify steps below:
git fetch
, it fetch from remote and put it in .git
folder, it has no effect on your local repo working directory and stage area git checkout A
git log origin/A..A
, if it has output after the command, you need to push the changes to remote firstly, and then do these steps again. git log A..origin/A
, if it has output after the command, that means you need to pull from remote. Note: before you pull from remote, please make sure step3 has no output.
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.