Bring branch up to date with master changes.

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Jee-Bee
Posts: 1210
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Bring branch up to date with master changes.

Postby Jee-Bee » Thu Nov 02, 2017 7:37 pm

Nice summery!!
Something for at Wiki?
chrisb
Posts: 10336
Joined: Tue Mar 17, 2015 9:14 am

Re: Bring branch up to date with master changes.

Postby chrisb » Thu Nov 02, 2017 10:38 pm

Jee-Bee wrote:
Thu Nov 02, 2017 7:37 pm
Nice summery!!
Thank you, I really struggled with this. But then I thought: this git stuff cannot be the show stopper for new developers
Something for at Wiki?
Yes, but hopefully someone can shed some light on the errors during the first checkout.
User avatar
Gift
Posts: 330
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Bring branch up to date with master changes.

Postby Gift » Thu Jun 14, 2018 6:00 pm

How I cleaning up a branch after the merge. Delete it and create a new?
wandererfan
Posts: 1840
Joined: Tue Nov 06, 2012 5:42 pm

Re: Bring branch up to date with master changes.

Postby wandererfan » Fri Jun 15, 2018 12:09 am

Gift wrote:
Thu Jun 14, 2018 6:00 pm
How I cleaning up a branch after the merge. Delete it and create a new?
How bad is it?
If it is just a few conflicts, use "git mergetool" to start a conflict resolution program like meld.
If it is pretty bad, "git reset --hard lastgoodcommithash" to get back to your last good state.
If it is hopeless, then your solution is good.
triplus
Posts: 7261
Joined: Mon Dec 12, 2011 4:45 pm

Re: Bring branch up to date with master changes.

Postby triplus » Fri Jun 15, 2018 12:35 am

Normally you would create a new branch for each PR. After the merge for sure you can delete the branch.

P.S. As for keeping your fork (your local master branch) in sync (with upstream master branch):

https://help.github.com/articles/syncing-a-fork/
User avatar
Gift
Posts: 330
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Bring branch up to date with master changes.

Postby Gift » Fri Jun 15, 2018 5:33 pm

Thx you both.
paullee
Posts: 848
Joined: Wed May 04, 2016 3:58 pm

Re: Bring branch up to date with master changes.

Postby paullee » Wed Aug 15, 2018 10:49 pm

Thanks for tips in this thread, I have successfully made some commits and PR :)

I keep this thread open and refer to the recommended steps, and would like to add some findings quoted below (probably for myself's reference)

How do I delete a Git branch both locally and remotely?
https://stackoverflow.com/questions/200 ... d-remotely

Delete Local Branch

Code: Select all

$ git branch -d branch_name
$ git branch -D branch_name
Delete Remote Branch

"As of Git v1.7.0, you can delete a remote branch using"

Code: Select all

$ git push <remote_name> --delete <branch_name>
e.g.
$ git push origin --delete <branch_name>
$ git push origin -d <branch_name>
"which might be easier to remember than"

Code: Select all

$ git push <remote_name> :<branch_name>