I am very new to git and I have been seeing this every once in a while.
For example:
- I work on my branch
branch-Afor few days (branch is created from develop fresh copy) - I do
git add . / git commit -m "blahblah"to stage and commit my changes - Now I want to get latest changes from remote and merge it into my branch so I ensure I work on latest code
to do so, I do
git checkout developto switch to my localdevelopbranch, git status shows I'm behind 37 commitsmyMBPro:MyProj$ git status On branch develop Your branch is behind 'origin/develop' by 37 commits, and can be fast-forwarded. (use "git pull" to update your local branch) Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory)and the list of deleted, untracked files follow
git fetch origin, thengit merge origin/developwhile ondevelopbranch shows:
myMBPro:MyProj user$ git fetch origin
myMBPro:MyProj user$ git merge origin/develop
Updating 799c6d7a..510c77ab
Fast-forward
.../Implementations/MyRenderer.cs | 39 ++--
... etc
- I would typically now switch to my branch
branch-Aand dogit merge developto merge develop tobranch-Abut I typically do firstgit statusto check all is OK. So, I stay ondevelopbranch and dogit status - The problem is that I see
git statusreporting probably every single file in my project as changed (some as untracked, some as staged and some as ready to be committed).
```
myMBPro:MyProj user$ git status
On branch develop
Your branch is up to date with 'origin/develop'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
, and the list of files ready to commit, files not staged, and files that are untracked follows after this.
So, I end up with lots of files that I haven't even touched, nor modified, nor added now showing as being somehow modified by me. As a result, I am hesitant to merge them in my branch-A.
Any idea why is this happening? Is it even normal (but to me it does not sound normal that files I have not changed appear as they are changed by me and now I need to start tracking them, stage and commit them.
I am on MacBookPro, using git from terminal and also using SourceTree