Ryan
Ryan

Reputation: 688

Pulling Changes From A Separate Branch With Git & Netbeans

I use Netbeans, and I have a branch on Git that I am working on where I am making some radical changes to our software. My team is pushing their changes to a separate branch.

Is there an easy way for me to pull the changes from my team's branch and merge them into my separate branch without affecting my team's branch?

I want to do this so that I can constantly test my radical changes with my team's latest changes to see if they are compatible.

Upvotes: 3

Views: 1049

Answers (1)

VonC
VonC

Reputation: 1326646

If you are the only one using your branch (or if you haven't pushed your branch yet), the good practice would be to rebase your branch on top of the team's branch.

git checkout yourBranch
git fetch
git rebase origin/teamBranch

That way, you replay your commits on top of the updated team's branch commits, and you can check if your code is still working.
Plus, once you will have pushed your branch, it will be easily merged to the team branch (fast-forward).

NetBeans with Git does support rebase.

https://blogs.oracle.com/geertjan/resource/git-rebase-in-74-dialog.png

Upvotes: 2

Related Questions