uwhpsc-2016 / homework2

Homework #2
0 stars 3 forks source link

Pushing Rebased Branch: Issue with pulling/pushing homework2 corrections #25

Open alyfarahat opened 8 years ago

alyfarahat commented 8 years ago

Just wanted to share my experience with pulling @cswiercz changes from the public homework2 repo and pushing them to my private homework2 repo. Here is the workflow I had. 1- Commit changes to the private repo prior to pulling in the changes from the public repo. 2- Pulled in from public repo and did a fair amount of work resolving conflicts. 3- Now my local branch is out of sync with the remote private repo, and git push origin master is rejected. 4- The only way that worked is to git push --force origin master. This is not ideal but it works in this very particular case. I am referring to this similar stackoverflow issue. http://stackoverflow.com/questions/8939977/git-push-rejected-after-feature-branch-rebase

cswiercz commented 8 years ago

This is odd.

Next time try pulling from your private remote before pushing changes. Also, git rebase is potentially very dangerous. At first it seems like a good idea but there are many situations in which it is inappropriate. See here: https://git-scm.com/book/en/v2/Git-Branching-Rebasing#The-Perils-of-Rebasing

alyfarahat commented 8 years ago

Yes, I think I should have pulled from my private repo. I just thought this would undo the conflict resolution work I made when pulling from my public repo. I also thought rebasing in this case is not dangerous since I am not sharing my private repo with anyone else.

I agree, I should have pulled from my private repo first.

cswiercz commented 8 years ago

No worries.

I also thought rebasing in this case is not dangerous since I am not sharing my private repo with anyone else.

Even if your remote is private to you it's still potential to create de-synchronized commit histories. It's always resolvable, but there would be a nasty network of commit paths in your resulting commit history.