Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

git - Why are there unstaged files after a synchronization?

For reference check this answer to see what is repo.

There is a situation that I cannot understand and I would like someone to explain to me.

So far I have been using repo sync to synchronize my code with a series of repositories. After I did this and I did repo status I could see a clean state. (repo status is like git status for all repositories)

However lately when I do that, I got a series of "modified" files. It is like doing git status and getting a lot of "changes not staged for commit" (modified: afile.ext)

Why is this happening? I thought once you synchronize you get the state of your repositories with the latest changes.

My git knowledge is failing me here. Any thoughts?

question from:https://stackoverflow.com/questions/65910906/why-are-there-unstaged-files-after-a-synchronization

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

According to the docs, repo sync is the equivalent of git fetch followed by a rebase. So it brings your remote-tracking branches into sync with the actual remote branches, and causes your current branch to be rebased onto the end of the remote tracking branch, but it has no effect on your working tree or the index or wherever the "modified" files are. You would still presumably need to say what you want done with the "modified" files: add-and-commit them, for instance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...