Home > Net >  Problem with git pull, doesn't merge all changes
Problem with git pull, doesn't merge all changes

Time:01-13

My project uses react.js, I want to migrate to typescript. My project has two branches "master" and "RoadToTS". The master branch has current changes on ts, in RoadToTS branch I make to migrate my components. But in parallel, my colleague makes some changes in the master branch.
For example. Master branch:

-src
--components
---header
----header.jsx

RoadToTS:

-src
--components
---header
----header.tsx

I want to merge my branches but in Header component exist some updates which I wanna get. When I do "git pull origin master" I have a conflict on file which is irrelevant for the header component. When I solved the conflict, I do "git commit -m", and "git pull" is successfully ended. But I didn't get current changes in Header component from master. When I try to do else "git pull", I get smth like this "Already up to date". In this case "git pull doesn't work correctly". Why?

CodePudding user response:

Try doing the following steps instead:

git checkout master
git pull
git checkout RoadToTS
git merge master

This should mean that your RoadToTS branch now has all the updated changes from master.

  •  Tags:  
  • Related