4 ms·
"The new default in Git 2.x is ‘simple’. It means that when doing a git push without specifying a branch, only your current branch will be pushed to the one git
by blumentopf 13y ago
"The new default in Git 2.x is ‘simple’. It means that when doing a git push without specifying a branch, only your current branch will be pushed to the one git pull would normally get your code from."
Hello? Why wasn't it called "current" instead of "simple"?
Why are these unintuitively named options so frequent in git?
- Nimi 13y agoA friend of mine said he contacted the people in charge and suggested some ways out of the counter-intuitiveness. He said they just didn't get it - if each feature works as specified, what's the problem?
- giovannibajo1 13y agoUnfortunately, "current" was already taken with a different meaning. There are subtle differences between the different modes. "current" means: push the current branch into a remote branch with the same name, no matter what. "upstream" means: push the current branch into the upstream branch, that is the remote branch from which you pull the current branch. "simple" means: push the current branch into the remote branch from which you are pulling, but only if they have the same name. This is supposed to be "more safe" for beginners than the "upstream" mode.
- canadev 13y agodoes 'upstream' mean push to the branch that this is tracking from? edit: yes. http://stackoverflow.com/questions/10002239/difference-between-git-checkout-track-origin-branch-and-git-checkout-b-branch http://stackoverflow.com/questions/10002239/difference-betwe... "Tracking means that a local branch has its upstream set to a remote branch." edit two: second question. does 'simple' mean the same as 'upstream' as long as the upstream branch (the one you are tracking from) has the same name as your local branch? I believe so but thought I'd double check. I have been using git for 4 years. I like it a lot more than svn. I never rebase. I still don't understand some of the things, like why they call it upstream, 'the branch you are pulling from', and tracking, when to me they all seem to mean the same thing.
- DigitalJack 13y agoIt's not a common use case in the github era, but you can pull from other repositories than the one you initially cloned.
- mikepurvis 13y agoStill pretty common if you contribute to repos which you don't have commit privileges to. Workflow is: 1. Clone library's master branch, begin using software. 2. Discover problem and commit a fix. 3. Use the Github webui to create a fork of the original repo. 4. git remote rename origin upstream 5. git remote add origin https://github.com/me/awesome-library 6. git push origin master:my-bug-fix 7. Use Github webui to create a pull request from your my-bug-fix branch into the upstream master. Having both remotes is necessary, though, when the thing you forked is being actively developed. If there's a review period of a few days, you may need to rebase from the upstream—you want to be doing this from the command line, not bumbling around in the Github webui trying to manage it there.
- TazeTSchnitzel 13y agoOn the contrary, it's quite common to need to pull down others' branches from GitHub.
- jlgreco 13y ago(In addition to "current" already being taken...) If it were called your "intuitive" name ("current", meaning "this is the current default"), then it would, extremely unintuitively, require renaming if it ever stopped being the default. You would be sacrificing future coherence for the sake of some very mild "intuitive sense" during the present. Complaining about git's standard porcelain is a popular sport, but so often the people who play it don't give proposals that make more sense than the status quo.
- jeorgun 13y agoI'm pretty sure "current" in this case is supposed to mean "branch you're currently on", which I'd definitely find more intuitive than "default". On the other hand, apparently that meaning isn't actually as clear as I'd have guessed, so maybe my intuitions about intuitiveness are off-base.
- jlgreco 13y agoThat is what current means right now. His proposal seems to be "call whatever happens to be the default 'current'". This of course gets you into a non-intuitive "The king is dead, long live the king" sort of situation.
- hibbelig 13y agoI understand that blumentopf meant that "current" should mean "push the current branch", just like "simple" is documented to do. He didn't know that there are actually _two_ behaviors that "push the current branch", and one of them is named "current" whereas the other, new one, is named "simple" ...
- clhodapp 13y agoYou are assuming one specific reading, when there are at least two valid ones. The way I read the comment was basically to say, "Geez, what git calls 'simple' ('push the current branch into the remote branch from which you are pulling, but only if they have the same name. This is supposed to be "more safe" for beginners than the "upstream" mode.') sounds like it would be better-named as 'current'. Isn't this obvious to everyone, including the git developers? Why are these unintuitively named options so frequent in git?" That said, I disagree with the sentiment, since there is already a 'current' mode to which the 'current' name seems to apply at least equally well.