Just a warning on branches that I've learned the hard way.
You have branch foo/bar. Do NOT EVER create a branch foo.
This may have changed since it's an internal git detail, but in the first case, foo would be a directory. In the second, foo is a file. Something can not be both a file and directory at the same time, so you're asking for a world of hurt.
I would recommend foo-bar style naming instead. Tab completion works just as well, and there's no unnecessary directory structure created in refs. It also completely avoids this error.
EDIT: I found one downside to this. If you like to set all your primary branches to be the default output for git show-branch and not show topic branches, you have to use subdirectories for your topic branches. I don't use show-branch much at this time, but this could matter to someone who does. Reference: git-scm.com/docs/git-show-branch#_...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just a warning on branches that I've learned the hard way.
You have branch
foo/bar
. Do NOT EVER create a branchfoo
.This may have changed since it's an internal git detail, but in the first case, foo would be a directory. In the second, foo is a file. Something can not be both a file and directory at the same time, so you're asking for a world of hurt.
Interesting, I've never run into this situation but it makes sense. Will keep this in mind.
I would recommend
foo-bar
style naming instead. Tab completion works just as well, and there's no unnecessary directory structure created inrefs
. It also completely avoids this error.EDIT: I found one downside to this. If you like to set all your primary branches to be the default output for
git show-branch
and not show topic branches, you have to use subdirectories for your topic branches. I don't useshow-branch
much at this time, but this could matter to someone who does. Reference: git-scm.com/docs/git-show-branch#_...