User Tools

Site Tools


userdoc:gitolite_track_set

Setting repo remotes with the "track" command

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.

SubcmdParamsSummary
setyour-repo-path orig-repo-path remote-name [--tags]Runs "git remote add [--tags]"
fetchyour-repo-path remote-namePerform "git fetch --prune"
rmyour-repo-path remote-namePerform "git remote remove"
listyour-repo-pathList remotes configured in your repository

:!: Note: it is almost never useful to track torvalds/linux.git, as our use of git alternates will already make sure that you don't have to push objects already present in torvalds/linux.git. This command is useful for objects that have not yet found their way into Linus's repo (e.g. those from linux-next).

Examples

All examples are for linux-next, since that's likely to be what most people want.

Setting

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.

Fetching

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

Listing

Forgot which remotes you already set up?

ssh git@gitolite.kernel.org track list \
    pub/scm/linux/kernel/git/mricon/linux # <-- Your repository path

Removing

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
userdoc/gitolite_track_set.txt · Last modified: 2016-03-11 18:15 by mricon