When I create a new branch, if I set "Configure upstream for push and pull" a warning appears (circled in blue in the screenshot). Why is that not recommended ? What potential problems or disadvantages does that have ?
I ran that warning through search engines and searched for it on https://git-scm.com and https://www.eclipse.org/egit/ but I found nothing, and when I click the "?" help button in that dialog nothing happens.
Also, if I wanted to follow the suggestion from that warning and "use remote branch", how do I do that ? Except of course the "Configure upstream for push and pull" checkbox, nothing that I change in that dialog causes the warning to disappear.
There is nothing wrong with setting another local branch as your upstream. It just means that git fetch
does nothing—you already have all your own commits; git merge
merges from the other branch; git rebase
rebases onto the other branch; and git push
attempts to fast-forward the other branch, or fails if it cannot.
The "other branch" (the upstream) is your own ordinary local branch, stored in your repository as usual. You are therefore your own upstream (and your own downstream, when viewed from the other branch). It feels a bit incestuous. :-)
It's completely not clear to me what other local branch EGit is going to set as the upstream, here. (I don't use EGit.) My guess, based on the stuff in the image, is master
.
I suppose it is telling you that storing your code at another location on the same device is not helping you to preserve the code. Whereas pushing to GitHub or BitBucket would allow you to destroy your device and still have the code. i.e. Storing your code locally twice is not more save.
To fix this make a repo on either BitBucket (allows private repo's for free) or GitHub and push your code there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With