Commit symlink outside of repo to git

Ondra K.

I have a repository with a backup of various config files. I would like the repo to contain only symlinks to the real config files (which are outside of the repository), so that I don't need to manually copy the config to repo in case of any changes.

When I tried to push symlink, the file was naturally unreadable in git or on other filesystem. Is there any way to force git to always follow the link and push original file, or is there any other approach?

Deltik

I can think of two solutions:

Reverse the Direction of the Symbolic Link

Put the configuration file in your Git repository and make a symlink to that file as the actual configuration used.

Use a Hard Link

If the Git repository is in the same file system as the configuration location, instead of ln -s, use ln to make a hard link so that the configuration used and the Git working directory file refer to the same file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Rollback to an old Git commit in a public repo

From Dev

How do i commit a windows symlink into Git

From Dev

Cloning a Git repo into a new repo - without commit history

From Dev

How to commit a git repo into a git repo (not submodule)

From Dev

Using git fast-export to export a repo starting at a given commit

From Dev

git pull with clean local repo causes merge commit

From Dev

clone from a git repo and commit to a new repository

From Dev

Unable to commit to an empty git repo

From Dev

When a commit was pushed into a remote Git Repo

From Dev

Git repo outside of Eclipse workspace

From Dev

Restore files in git repo without commit

From Dev

How to "overwrite" in a single commit a git repo with another repo

From Dev

Fetch specific commit from remote git repo

From Dev

Can't push a commit of Git repo with a submodule

From Dev

Git change author name/email in a long ago commit in team repo

From Dev

searching commit messages in the whole git repo

From Dev

Git: How to revert a symlink commit which replaced a submodule?

From Dev

Auto commit and auto push changes in local repo to git

From Dev

How to commit my files in a git bare repo

From Dev

Git submodule's commit matching a tag in the main repo

From Dev

git pull with clean local repo causes merge commit

From Dev

push from git/svn repo into a git/branch at specific commit

From Dev

Automatic Git Commit like `golang` repo in Github?

From Dev

Get GIT repo ID by commit ID with Visual Studio Online

From Dev

writing a one-liner to step back one commit in a git repo

From Dev

How do I fork a github project to a git repo outside github?

From Dev

clone git repo at specfic commit

From Dev

git adds file from outside repo folder?

From Dev

Find a git commit in a repo history that was a directory rename or move

Related Related

  1. 1

    Rollback to an old Git commit in a public repo

  2. 2

    How do i commit a windows symlink into Git

  3. 3

    Cloning a Git repo into a new repo - without commit history

  4. 4

    How to commit a git repo into a git repo (not submodule)

  5. 5

    Using git fast-export to export a repo starting at a given commit

  6. 6

    git pull with clean local repo causes merge commit

  7. 7

    clone from a git repo and commit to a new repository

  8. 8

    Unable to commit to an empty git repo

  9. 9

    When a commit was pushed into a remote Git Repo

  10. 10

    Git repo outside of Eclipse workspace

  11. 11

    Restore files in git repo without commit

  12. 12

    How to "overwrite" in a single commit a git repo with another repo

  13. 13

    Fetch specific commit from remote git repo

  14. 14

    Can't push a commit of Git repo with a submodule

  15. 15

    Git change author name/email in a long ago commit in team repo

  16. 16

    searching commit messages in the whole git repo

  17. 17

    Git: How to revert a symlink commit which replaced a submodule?

  18. 18

    Auto commit and auto push changes in local repo to git

  19. 19

    How to commit my files in a git bare repo

  20. 20

    Git submodule's commit matching a tag in the main repo

  21. 21

    git pull with clean local repo causes merge commit

  22. 22

    push from git/svn repo into a git/branch at specific commit

  23. 23

    Automatic Git Commit like `golang` repo in Github?

  24. 24

    Get GIT repo ID by commit ID with Visual Studio Online

  25. 25

    writing a one-liner to step back one commit in a git repo

  26. 26

    How do I fork a github project to a git repo outside github?

  27. 27

    clone git repo at specfic commit

  28. 28

    git adds file from outside repo folder?

  29. 29

    Find a git commit in a repo history that was a directory rename or move

HotTag

Archive