簡體   English   中英

用於在Windows上進行符號鏈接轉換的Git掛鈎

[英]Git hooks for symlink convertion on Windows

我嘗試在Windows上制作git hooks,自動將位於存儲庫中的unix符號鏈接轉換為本地機器上的hardlinks + junctions窗口。 我怎么可能這樣做? 我們使用基於Windows和Unix的操作系統。

我像Windows中的Git Symlinks一樣擴展了Git的命令列表

我讀了關於鈎子並創建了post-checkout鈎子:

#!/bin/sh
exec git rm-symlinks

它可以工作,當我執行git checkout #branch_with_symlink時,但當我做下一次checkout時,git寫道:

error: Your local changes to the following files would be overwritten by checkout:
#path_to_symlink
Please, commit your changes or stash them before you can switch branches.

git狀態:

# On branch #branch_with_symlink
nothing to commit, working directory clean

git沒有預先簽出鈎子,我不明白,我是如何進行這種轉換的

您可以嘗試使用塗抹過濾器,而不是使用鈎子。 它們更適合改變文本文件的內容而不是符號鏈接,但我認為你可以讓它們起作用。

這里有一些文檔: http//git-scm.com/docs/gitattributes#__code_filter_code

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM