How can I keep two files in sync within the same repository?

前端 未结 2 771
生来不讨喜
生来不讨喜 2021-01-14 06:47

My repository in git looks like this:

-Project Repo
    -Sub Folder 1
         -File 1
         -File A
    -Sub Folder 2
         -SubSub Folder
                    


        
2条回答
  •  天命终不由人
    2021-01-14 07:28

    Hopefully a symbolic link is all you need.

    If you are in Linux/Unix you would issue the symlink creation command as follows:

    cd ".../Project Repo/Sub Folder 2/"
    ln -s "../Sub Folder 1/File 1" "File 2"
    

    In a version of Windows that support symbolic links, you can try the mklink command:

    cd ...\Project Repo\Sub Folder 2
    mklink "File 2" "..\Sub Folder 1\File 1"
    

提交回复
热议问题