hakoerber / git-repo-manager

A git tool to manage worktrees and integrate with GitHub and GitLab
https://hakoerber.github.io/git-repo-manager/
GNU General Public License v3.0
62 stars 9 forks source link

Streamline & document worktree handling #34

Closed hakoerber closed 2 years ago

hakoerber commented 2 years ago

Currently, some things are a bit hit-and-miss:

Remotes

Overview:

In case we have default remote, everything is easy: That's the remote we use to set up remote tracking branches and pull/push/fetch from.

If there are multiple remotes without a default, the remote will always have to be specified for push/pull/fetch and tracking branches. I guess this is a very rare setup, so it will be fine to emit warnings and point users to default_remote.

Remote tracking branches

The desired behaviour is:

When we create a worktree, there are a few different cases to handle:

Worktrees & Subdirectories

The rule is: Branch name == Worktree name. As a branch name can contain a slash, we cannot really handle subdirectories, as there would be no way to tell a subdirectory and a branch prefix apart. So subdirectories need to be removed.