Creating a remote inside a directory of remotes
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?
- Why does git require stash save-pop to switch branch?
- git set-upstream-to VR track
- git: copy a worktree of a remote branch that is not present at local
- Rebasing to new versions in upstream git (GitHub) with losing all local changes
- How to connect unconnected git histories?
- Merging commits from branch to master -> odd-looking tree
One Solution collect form web for “Creating a remote inside a directory of remotes”
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“.