How do I selectively create symbolic links to specific files in another directory in LINUX?
Assuming you are in a directory that contains directories bar1
and bar2
:
find bar1 -name '*foo*' -not -type d -not -name '*.cc' -exec ln -s $PWD/'{}' bar2/ \;
Linux: My symbolic links are coming out as broken
ln -s "$PWD/$pathname" "$mods/$name"
What could I be doing wrong?
As $pathname
is already absolute, it's the prepending of $PWD/
which does harm; just drop that.
How to use submodules publicly, but symlinks to a single clone locally?
So Git apparently sees the fact that it's a symbolic link, instead of following through to the directory.
Yes, Git would see such a change, because that submodule is declared in the parent repo as a special entry in the index.
Making a symlink would replace that special entry by a file of another type.
What you could do is try playing with GIT_WORK_TREE
(as in "Including submodules in git checkout to GIT_WORK_TREE
in hook").
But a more simpler solution would be to:
- keep your submodule right where they are.
- add another clone of that submodule repo where you want it (
/path/to/sub
). - detect any changes from the original submodule folder with a
git --work-tree=/path/to/sub
status from within your duplicated submodule folder in your parent repos.
Related Topics
To What Extent Can One Rely on Writing to Disk When Sigterm Is Given
Why Can One Remove/Rename Open Files in Linux
How to Execute a Command in a Bash Script and Then Focus The Appearing Window
How to Distribute C++11 Shared Library on Centos6
Mqtt Socket Error on Client <Unknown>
How to Use 9-Bit Serial Communication in Linux
Sshfs, Linux - How to Mount with Read-Only Access
Does Gcc Support Command Files
How to Clear Docker Task History
Need Some Advise to Begin Programming on Arm (With Linux) Platform
Trying to Delete All But Most Recent 2 Files in Sub Directories
How to Attach Domain Name to My Server
Problem of Understanding Clock_Gettime
Tail Logback Log Files with Log Level Coloring in Linux Server
How to Send Email from The Command Line
On Linux, Is Access() Faster Than Stat()
How to Change Core Pattern Only for a Particular Application