feat(git-clone): add support for tree git clone url
michaelbrewer opened this issue · comments
In Open in Coder flow, some url target a specific branch, ideally git-clone
would support this.
Gitlab urls
Example urls to support
# url: https://gitlab.com/mike.brew/repo-tests.log/-/tree/feat/branch
git clone https://gitlab.com/mike.brew/repo-tests.log -b feat/branch repo-tests.log
Github urls
Example urls to support
# url: https://github.com/michaelbrewer/repo-tests.log/tree/feat/branch
git clone https://github.com/michaelbrewer/repo-tests.log -b feat/branch repo-tests.log
Bitbucket urls
Example urls to support
# url: https://bitbucket.org/gyftteam/repo-tests.log/src/dc427712c41a1046c355db8fb9df5da883790627/?at=feat%2Fbranch
git clone https://bitbucket.org/gyftteam/repo-tests.log -b feat/branch repo-tests.log
# url: https://bitbucket.org/gyftteam/repo-tests.log/src/main/
git clone https://bitbucket.org/gyftteam/repo-tests.log -b main repo-tests.log
# url: https://bitbucket.org/gyftteam/repo-tests.log/src/develop/
git clone https://bitbucket.org/gyftteam/repo-tests.log -b develop repo-tests.log
NOTES
It might be useful to add a flag to enable this or to have a way to set the tree reversal path used :
/-/tree/
- for gitlab/tree/
- for github/src/
- for bitbucket
However there is often the case to have a single workspace template for "Open in Code" that supports multiple git projects.
Another way could be to have a list of supported endpoints?
github.com
-github
bitbucket.org
-bitbucket
gitlab.com
-gitlab
then you can add self-hosted versions
source.mycorp.com
-ado
git.mycorp.com
-gitlab
related pull request: #210