1

I am working on a project with multiple contributors who work on adding new features. When I git branch -a, it shows something like this:

remotes/origin/usr/username1/featureA
remotes/origin/usr/username2/featureB
remotes/origin/usr/username2/featureC
remotes/origin/usr/username2/featureD
remotes/origin/usr/username3/featureE

Local changes are pushed to these remotes before they are reviewed and merged with the master release branch. How can I create a remote that is also in this format, with my username and my feature name? Also, is this a path with directories for each user or is it just a string containing a slash?

Casey Patton
  • 4,021
  • 9
  • 41
  • 54

1 Answers1

1

How can I create a remote that is also in this format, with my username and my feature name?

You don't: Other would add your repo as a remote (an upstream repo), and fetch your branch, which will be listed for them as their branches is listed for you.
That is: if you create a branch with '/' in it: it is called hierarchical branch names

git checkout -b usr/myusername/featureX

Jakub Narębski does mention though:
"One caveat is that you can't have both branch 'foo' and branch 'foo/bar' in repository."

is this a path with directories for each user or is it just a string containing a slash?

The latter, it defines a branch name with namespaces.

This is often see in gitolite-managed git repositories, with a feature like "personal branches".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250