Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symbolic links in TFS 2010 Source Control?

As far as I know, Team Foundation Server 2010's source control (and prior versions) doesn't support linking (Symbolic links) of files.

Linking (per Visual SourceSafe) was the concept of providing one "hard" file in a folder, and then "linking" to it in other locations - exactly like file system hard links are designed.

Does anyone know if files can be linked at all? I realise it is not a good practice in general, but I have some scenarios where it makes sense.

According to an answer in this thread: Linking TFS source control folder from another TFS project it's not possible, but I can't find a definitive answer.

Closest thing I can find courtesy of Google is a thread on the MSDN forum but it's quite old (2006). I'm pretty much assuming that this is still the answer though (unless anyone knows differently)?

like image 797
RobS Avatar asked Jun 03 '11 04:06

RobS


People also ask

Where are symbolic links stored?

There is no way to find all the symbolic links pointing to a file. They could be anywhere, including on a filesystem that isn't mounted. With GNU or FreeBSD find, you can use find /some/dir -samefile /path/to/foo to find all the hard links to the file /path/to/foo that are under /some/dir .

What functionality does a symbolic link provide?

A symbolic link creates a file in your directory and acts as a shortcut to a file or folder. For example: I have a directory- let's say example.com. However, I want a shortcut to another directory within the example.com. To do this, you would create a symbolic link.

What are symbolic links How many types are there?

Symlinks can take two forms: Soft links are similar to shortcuts, and can point to another file or directory in any file system. Hard links are also shortcuts for files and folders, but a hard link cannot be created for a folder or file in a different file system.

Is symbolic link a soft link?

A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system.


2 Answers

This thread is more recent (2010), about TFS 2008 and 2010:

TFS (2008 and 2010) do not have support for links. There is a server-side extension for TFS 2010 (ie. what VS2010 used for gated checkin) but this sounds like a client-side solution since the link must be converted to a file to be recognized by the client OM.

If you only work with the command line, how about a wrapper tool for some version control operations? For example, the check-in wrapper would convert links to a linktext file and add or replace the existing linktext file before doing the normal check-in. The check-out wrapper would check-out the corresponding linktext file. Note that there will be quite a bit of work since you'll have to wrap many commands.

like image 123
VonC Avatar answered Sep 20 '22 02:09

VonC


There seems to be a work-around for this for Linux-based systems.

This page - Applying Unix Filesystem Attributes to Files under Version Control - describes how to use a .tpattributes file text file to store details about file attributes. The article applies to the Visual Studio 2010 edition.

The process is described here: How to work with symbolic link files under Linux/Unix and TFS?. It involves the use of both a .tpattributes file, and a 0-byte file representing the symlink.

There have been some reports of success for this, according to the comments on an updated request to Microsoft for this feature to be implemented in TFS 2015.

In Perforce, symlinks may just be checked-in without having to go through any of this.

like image 28
CJBS Avatar answered Sep 23 '22 02:09

CJBS