Hello everyone,
I and my friend were trying to build a project together using Github, for practicing.
this is what we have done, I hope you correct us if we are doing something wrong, also we have a problem in keeping our workflow sync together, so please we need your help.
- we created an organization and created a repo in it (as our upstream).
- then, each one, forked this repo to his GitHub profile (as our origin).
- then cloned this repo locally to our machines.
- I created some branches each one with a new feature to be added. then pushed it to my (origin)
- then made a pull request to the (upstream) with one of these branches and we merged it.
- when we tried to pull request other branches, Github said that (these branches can’t be merged automatically) because the (upstream) has been changed since we created these branches.
- now we are trying to update these branches so we can merge them, but we don’t know which method is the best to use.
- we updated our local master by using
git pull upstream master
. now our (local master) is up to date with (upstream) and we need to update the branches also. But we don’t know what to do next.
-
Should we use
git rebase
?
after I read about it I thought that it is a bad idea, as it changes the history in a way that it may cause it to be so complicated, and I think it’s advanced. correct me if I’m wrong. -
Should we create new branches locally?
and copy/paste the changes to them then push these new branches to GitHub then pull request them then merge. I thought of this way as the safest and simplest way for me. but Idk if this what I should do. -
I read about git merge also as an alternative to git rebase
and Idk if I should use it too,
actually I’ve read articles about both of them (rebase and merge) but Idk If I have a good understanding.
I would appreciate any help, thanks in advance