Home > Enterprise >  Why do I get "nothing to commit, working tree clean" after a merge request?
Why do I get "nothing to commit, working tree clean" after a merge request?

Time:10-21

Why does git status in branch develoment after a merge request on origin develoment in gitlab tell me "nothing to commit, working tree clean" but when I do a git pull in branch development it fetches the latest status. I can't imagine that this is a bug. Git and Gitlab are too ingenious for that. What am I getting wrong?

git checkout development
git status

On branch development
Your branch is up to date with 'origin/development'.

nothing to commit, working tree clean

git pull

remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 16 (delta 14), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (16/16), 1.56 KiB | 177.00 KiB/s, done.

Updating ec27aa4..75941c3
Fast-forward
 .env                           |  1  
 .env.node                      |  3   -
...
 8 files changed, 25 insertions( ), 12 deletions(-)

CodePudding user response:

What am I getting wrong?

git status doesn't know about updates to remote branches; it just looks at the current state of your local repo. If you were to run git fetch, git would download the remote changes. If you then run git status, it'll tell you that your local branch is behind.

git pull is essentially a combination of git fetch and git merge, so running it automatically gets the remote changes.

  • Related