If a TFS user has no read access to a changeset, then TFS responds with a "TF14098: Access Denied" error. This error aborts the fetch operation. Add the --ignore-restricted-changesets option which allows the user to ignore these respective changeset. If the option is set, then git tfs will import the access restricted changeset as empty commit and ignore the error.
4.0 KiB
Summary
The fetch command fetch all the new changesets from a TFS remote
Synopsis
Usage: git-tfs fetch [options] [tfs-remote-id]...
-h, -H, --help
-V, --version
-d, --debug Show debug output about everything git-tfs does
-i, --tfs-remote, --remote, --id=VALUE
The remote ID of the TFS to interact with
default: default
-t, --up-to=VALUE, up-to changeset # (optional, -1 for up to maximum, must be a number, not prefixed with C)
-I, --auto-tfs-remote, --auto-remote
Auto-detect (from git history) the remote ID of
the TFS to interact with
--all, --fetch-all Fetch TFS changesets of all the initialized tfs
remotes
--parents Fetch TFS changesets of the parent(s)
initialized tfs remotes
--authors=VALUE Path to an Authors file to map TFS users to Git
users
--batch-size=VALUE Size of the batch of tfs changesets fetched (-1 for all in one batch)
--ignore-regex=VALUE a regex of files to ignore
--no-metadata leave out the 'git-tfs-id:' tag in commit
messages
Use this when you're exporting from TFS and
don't need to put data back into TFS.
--ignore-branches-regex=VALUE
Don't initialize branches that match given regex
--ignore-not-init-branches
Don't initialize additional branches (only use what already was initialized)
--ignore-restricted-changesets
Ignore changesets that the TFS user has no read access to
-u, --username=VALUE TFS user name
-p, --password=VALUE TFS password
Examples
Simple
To fetch all the changeset of the default remote:
git tfs fetch
Fetch from a branch
To fetch all the changesets of the tfs/myBranch remote:
git tfs fetch -i myBranch
Fetch from the current branch
To fetch all the changesets of the current remote:
git tfs fetch -I
The current remote depend of the git commit that is currently checkouted. Git-tfs will look in the history to find the appropriate remote to fetch.
Fetch from all the remotes
To fetch all the changesets of all the initialized remotes
git tfs fetch --all
Note: you could see all the tfs remotes already initialized using command git tfs branch and
all that exists on the tfs server using command git tfs branch -r
Authentication
For the use of parameters --username and --password, see the clone command.
Map TFS users to git users
For the use of parameter --authors, see the clone command.
Fetching merge changesets
Merge changesets will be automatically fetched and created as a merge commit if the tfs branch merged has already been initialized in the git repository. If the tfs branch merged has not be initialized, the merge changeset will be created as a normal commit (not a merged one) and this warning message will be created :
warning: this changeset 34 is a merge changeset. But it can't have been managed accordingly because one of the parent changeset 33 is not present in the repository! If you want to do it, fetch the branch containing this changeset before retrying...
Batch size of fetched changesets
The option --batch-size permit to specify the number of changesets fetched from tfs at the same time (default:100).
You could use this option to specify smaller batch size if git-tfs use too much memory because changesets are huge.
This option is not saved but you could add it to the git config file (key git-tfs.batch-size). See config file doc.
Note: this option could also be specified during the clone.