Git和符号链接 [英] Git and symlinks

查看:134
本文介绍了Git和符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题:


  1. 我希望git忽略符号链接

  2. 后来它提交了符号链接。我可以删除这些提交的符号链接。它们已被推送到远程。
  3. 在$ $ c中添加所有符号链接 $ c> .gitignore

      find。 -type 1>> .gitignore 

    从存储库中删除所有符号链接

      find。 -type l -exec git rm --cached {} \; 


    I have 2 issues:

    1. I want git to ignore symlinks
    2. I have noticed late that it is committing symlinks. HOw can i remove these committed symlinks. They have already been pushed to a remote.

    解决方案

    add all symbolic links in .gitignore

    find . -type l >> .gitignore
    

    remove all symbolic links from repository

    find . -type l -exec git rm --cached {} \;
    

    这篇关于Git和符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆