Open alyfarahat opened 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
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.
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.
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 togit 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