lookitraffic.blogg.se

Git annex tortoise
Git annex tortoise








git annex tortoise
  1. #GIT ANNEX TORTOISE UPDATE#
  2. #GIT ANNEX TORTOISE WINDOWS#

  • POSIX compliance (well, except for those mklink calls, of course) - no more Bashisms!.
  • These aliases have been useful enough for me that a true post-checkout solution hasn't been necessary.

    #GIT ANNEX TORTOISE WINDOWS#

    # new file: lnk_bar/nuthafile # POLLUTIONįor this reason, it's nice to include these aliases as steps to perform for Windows users before-and-after building a project, rather than after checkout or before pushing. Using our "example repo" from before: echo "I am nuthafile" > dir/foo/bar/nuthafile If yourself or others forget to git checkout-symlinks before doing something with potentially wide-sweeping consequences like git add -A, the local repository could end up in a polluted state.

    git annex tortoise

    But tabs or newlines? YMMV… (By this I mean: don’t do that, because it will not work.) Usage: git checkout-symlinks, which undoes git rm-symlinks, effectively restoring the repository to its natural state (except for your changes, which should stay intact).Īnd for submodules: git submodule foreach -recursive git checkout-symlinksĭirectories/files/symlinks with spaces in their paths should work. Git config -global -symlinks '!git checkout-symlinks' Printf 'Restored git symlink: %s -> %s\n' "$symlink" "$(cat "$symlink")" Restoring git symlinks on Windows git config -global alias.checkout-symlinks '!'"$(cat /dev/null 2>&1 To remove symlinks from submodules, just use git's built-in support for iterating over them: git submodule foreach -recursive git rm-symlinksīut, for every drastic action like this, a reversal is nice to have. The benefit of using hardlinks+junctions over "true" NTFS symlinks is that elevated UAC permissions are not required in order for them to be created. Symlinks will be replaced with NTFS hardlinks (in the case of files) or NTFS junctions (in the case of directories). This alias can remove git symlinks one-by-one or all-at-once in one fell swoop. Git config -global alias.rm-symlink '!git rm-symlinks' # for back-compat.

    git annex tortoise

    'Note: source MUST be a path relative to the location of target' 'Create a symlink in a git repository on a Windows host.\n' \ With this information it's possible to add a few git aliases that allow for the creation and manipulation of git symlinks on Windows hosts.Ĭreating git symlinks on Windows git config -global alias.add-symlink '!'"$(cat \n' \ Thanks to Josh Lee for pointing out the fact that git commits symlinks with special filemode 120000. Our developers are in much the same situation as OP's: a mixture of Windows and Unix-like hosts, repositories and submodules with many git symlinks, and no native support (yet) in the release version of MsysGit for intelligently handling these symlinks on Windows hosts. Q: "Has anybody already worked on such a script?" can I recursively find out the dummy "symlink" files git creates?"Ī: Yes, a post-checkout script is implementable! Maybe not as a literal post- git checkout step, but the solution below has met my needs well enough that a literal post-checkout script wasn't necessary. Q: "Is this post-checkout script even implementable? i.e. (More on this under "limitations" below.) Q: "What, if any, downsides do you see to this approach?"Ī: There are indeed a few downsides to the proposed solution, mainly regarding an increased potential for repository pollution, or accidentally adding duplicate files while they're in their "Windows symlink" states. I was asking this exact same question a while back (not here, just in general), and ended up coming up with a very similar solution to OP's proposition.īut first I'll provide direct answers to OP's 3 questions: See this more modern answer before digging into the following deep git hacks discussion.

    #GIT ANNEX TORTOISE UPDATE#

    For most Windows developers struggling with symlinks and git on Windows and the issues of sharing a repo with *nix systems, this topic is a solved problem - once you update your Windows understanding of mklink a bit and turn on Developer Mode.










    Git annex tortoise