What is the best way to update a branch?

Asked

Viewed 119 times

0

Currently when I update a branch with the modifications I made on another computer I do the sequinte:

git fetch -p

Then the origin/branchName and branchName are separated being the branchName outdated (One important detail is that in the branch I don’t do multiple commits, but only one to rebase when I commit push origin branchName -f)

To join the origin/branchName and branchName I’ll tell you what:

git cehckout -B branchName origin/branchName

Work for me works, but am I doing it right? Is there any way to make it better?

1 answer

1

The command git merge should be enough to update your branch.

According to the documentation, if you do not specify a branch, git will merge the remote branch of your current branch, which in your case will be the origin/branchName.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.