Frage

I'd like to automate the creation of feature branches that match in multiple projects. I can script this but to speed things up it would be nice if I could just tell the remote repo to create the branch, without cloning the entire source code. Is this possible?

War es hilfreich?

Lösung

If your remote repo isn't bare, then you can do all this using ssh and running the git commands directly on your remote repository. The syntax for ssh is pretty simple: ssh user@host command:

ssh dev1@remotebox git branch newbranchname
ssh dev2@remotebox git checkout newbranchname
ssh jenkinsci@remotebox git pull --quiet --no-commit

And so on.

If your remote repo is bare or if you cannot ssh to the remote repository, then no, you can't do this. The git transfer protocol doesn't permit it. As far as I know, the only commands you can run on remote repositories without a local clone all have the "-remote" suffix. ls-remote, peek-remote and parse-remote.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top