Basically I noticed that when I try to commit my changes and push them into my feature
branch sometimes other people’s commits will be commited as well after rebasing.
E.g.:
- I work on
feature
branch, modifying “X” class - Somebody merges something to
master
, modifying “Y” class - So I
git checkout master
git pull
git checkout feature
branchgit rebase master
And after these steps when I try to push, the IDE will tell me that “X” and “Y” class related commits will be pushed into my remote branch.
I would like to emphasize that this behavior is random, so sometimes it occurs, sometimes it does not.
What could be the problem? Am I doing something wrong?
Git might include commits from the master
branch due to conflicts or how the changes are applied.
Follow the below steps,
git rebase -i master
– Inorder to avoid this issuegit status
– Then check your changesgit log
– after rebasinggit pull --rebase
– to streamline the process