You are not logged in.

#1 2015-10-01 10:32:24

esa
Member
Registered: 2011-12-29
Posts: 143
Website

[SOLVED] Hardlink and Github

Heyas

For plain local work, this would not be an issue for me to ask, however, as i share them, i'd like to be sure. (but me dont want to do 2 git pushes just to try for real)

I have a single script that manages the installations for my scripts, it uses a single configuration file.
Now during updates of that, for the testinig, i usualy install (one of) my other projects over and over again.

Figured a theory, hardlink from the 'installer script' to the current project, lets me skip the copy of it.
While beeing all local, i know all those hardlinks refer to the same content('node'), and as long any of those remains, the original data remains.

My question now is, what happens if i push such a hardlink to github and someone clones that from there?
Will they get the 'real' file, or just an invalid/broken hardlink (as it does with  'ln -s' if that goes out of the project dir)?

Thanks

Last edited by esa (2015-10-01 10:52:22)


Author of: TUI (Text User Interface for scripts), VHS (Video Handler Script, using ffmpeg) and YASSI (Yet Another Simple Script Installer)

Offline

#2 2015-10-01 10:41:48

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: [SOLVED] Hardlink and Github

Git treats hardlinks like normal files (they are normal files), so pushing the data works. Since git is not aware of hardlinks, you will break the connection if you modify your working copy (e.g. with checkout or reset --hard).
Edit: So yes, git breaks hard links. This will result in you having two copies of the same file and not in a data loss.

Last edited by progandy (2015-10-01 10:43:03)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2015-10-01 10:51:56

esa
Member
Registered: 2011-12-29
Posts: 143
Website

Re: [SOLVED] Hardlink and Github

Thank you.
/solved


Author of: TUI (Text User Interface for scripts), VHS (Video Handler Script, using ffmpeg) and YASSI (Yet Another Simple Script Installer)

Offline

#4 2015-10-01 12:31:53

progandy
Member
Registered: 2012-05-17
Posts: 5,196

Re: [SOLVED] Hardlink and Github

If you want to recreate a local hardlink, then you can try to add a post-checkout hook to your working copy.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB