This is an old revision of the document!
This is useful if you want to avoid sending a lot of objects when performing "git push
" and want to copy those objects from another local repository first.
Subcmd | Params | Summary |
---|---|---|
set | your-repo-path orig-repo-path remote-name [--tags] | Runs "git remote add [--tags] " |
fetch | your-repo-path remote-name | Perform "git fetch --prune " |
rm | your-repo-path remote-name | Perform "git remote remove " |
list | your-repo-path | List remotes configured in your repository |
All examples are for linux-next, since that's likely to be what most people want.
Set up linux-next as a remote for your own repository.
ssh git@gitolite.kernel.org track set \ pub/scm/linux/kernel/git/mricon/linux \ # <-- Your repository path pub/scm/linux/kernel/git/next/linux-next \ # <-- The repository you want linux-next [--tags] # <-- remote name (pass --tags if you want tags)
This will do the following:
cd $REPOS/pub/scm/linux/kernel/git/mricon/linux.git git remote add --no-tags linux-next $REPOS/pub/scm/linux/kernel/git/next/linux-next.git git fetch linux-next --prune
If you passed --tags
at the end of the command, then --no-tags
will be omitted and you'll get all the tags from the remote repository as well.
Right before you do "git push
", run the following command to fetch the latest objects from linux-next and thus avoid pushing them over your ssh connection during your own git push
:
ssh git@gitolite.kernel.org track fetch \ pub/scm/linux/kernel/git/mricon/linux \ # <-- Your repository path linux-next # <-- Remote name you want to fetch
This will do the following:
cd $REPOS/pub/scm/linux/kernel/git/mricon/linux.git git fetch linux-next --prune
Forgot which remotes you already set up?
ssh git@gitolite.kernel.org track list \ pub/scm/linux/kernel/git/mricon/linux # <-- Your repository path
Done with a remote? You can just leave it there, or remove it entirely:
ssh git@gitolite.kernel.org track rm \ pub/scm/linux/kernel/git/mricon/linux \ # <-- Your repository path linux-next # <-- Remote name you want to remove
This will do the following:
cd $REPOS/pub/scm/linux/kernel/git/mricon/linux.git git remote remove linux-next