Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git file is beyond a symbolic link

Tags:

git

symlink

I've ran into an issue wherein Git believes that a file is beyond a symbolic link, and that, thus, it cannot be version controlled, but it appears to be a real file.

[root@r1 h]# stat -f conf/core-site.xml 
  File: "conf/core-site.xml"
    ID: 5c7eb82882a6e866 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 2735511    Free: 510158     Available: 371202
Inodes: Total: 694960     Free: 597972

Additionally, I've tried "readlink" to show the link pointer, but to no avail.

How does Git determine if a file is a symbolic link or not?

like image 660
jayunit100 Avatar asked Feb 09 '13 01:02

jayunit100


People also ask

How do I remove a symbolic link in git?

The best way to remove a symlink is with the appropriately named “unlink” tool. Using unlink to delete a symlink is extremely simple, you just need to point it at the symbolic link to unlink and remove. As always with the command line, be sure your syntax is precise.

What is symbolic link in git?

A symbolic link is a special type of file whose contents are a string that is the pathname of another file, the file to which the link refers. (The contents of a symbolic link can be read using readlink(2).) So a symbolic link is one more file, just as a README.md or a Makefile .


1 Answers

/project/subproject/conf

If you need to add the /conf into the main project and add symlinks for subprojects,

  1. Remove conf from subproject and add to the project, and commit changes.
$ cp /project/subproject/conf /project
$ rm /project/subproject/conf
$ commit changes    
  1. Then add the symlink and commit
$ cd /project/subproject/
$ ln -s ../conf/ conf
$ commit changes
like image 189
Thara Perera Avatar answered Oct 11 '22 13:10

Thara Perera