Export (0) Print
Expand All

Add command

Adds files and folders to version control.

Tip Tip

Tip Before you add files to version control, you should first set up the workspace on your dev machine. See Workspace Command or Set up Team Foundation Version Control on your dev machine.

Requirements: See Team Foundation Server permissions.

tf add itemspec [/lock:(none|checkin|checkout)] [/encoding:filetype] 
[/noprompt] [/recursive] [/noignore] [/login:username,[password]] 

Parameter

Description

/encoding: filetype

Ignore this parameter.

itemspec

Specifies the scope of the items to add. You can specify more than one itemspec argument.

For syntax, see Use Team Foundation version control commands.

/lock

Applies or removes a lock. See Use Team Foundation version control commands.

/login:username,[password]

Specifies the user account to run the command. See Use Team Foundation version control commands.

/noignore

By default certain types of files (for example, .dll files) are ignored by version control. The rules in a .tfignore files apply to the Add command when you specify a wildcard in your itemspec. To override the application of the rules in this case, specify /noignore.

You can configure which kinds of files are ignored using a .tfignore file (see Add Files: .tfignore file).

/noprompt

Suppresses the display of windows and dialog boxes and redirects output data to the command prompt. See Use Team Foundation version control commands.

/recursive

Recursively adds items in the specified directory and any subdirectories.

In all the following examples, assume that $/SiteApp/Main/ is mapped to c:\code\SiteApp\Main\ in the workspace.

New files in a local workspace are automatically detected. You can promote these newly detected files to your pending changes.

c:\code\SiteApp\Main\SolutionA\Project1>tf add

Adds the latest versions of all items (except those that are ignored) in a local workspace.

c:\code\SiteApp\Main\SolutionA\Project1>tf add /noignore

Adds the latest versions of all items in a local workspace.

c:\code\SiteApp\Main>tf add program1.cs program2.c

Adds the files program1.cs and program2.c.

c:\code\SiteApp\Main>tf add *.cs /recursive

Adds all C# code files (.cs) in the current directory and any subdirectories.

  • Tip The results of this command are queued as pending changes (see Status command) and do not take effect on the server until you check in (see Checkin command).

  • Tip If you need to set aside changes (and perhaps also want to clean your workspace for another task), use the Shelve Command.

Show:
© 2014 Microsoft