【问题标题】:Can moving folders/files in github cause a problem?在 github 中移动文件夹/文件会导致问题吗?
【发布时间】:2020-09-21 06:50:33
【问题描述】:

我的 github 仓库是:https://github.com/zorlakov/moviesAndShows 为了访问 react 文件和文件夹(src、public 等),您首先必须打开 movies-and-shows 文件夹。我正在考虑将该文件夹中的所有内容复制到父文件夹中,然后删除该文件夹并推送到 github。这会造成问题吗?

【问题讨论】:

    标签: github


    【解决方案1】:

    这对 Github 甚至 Git 来说都不是问题。

    但是,如果您想保留历史记录并确保 Git 能够检测到移动/重命名,您应该分步进行:

    git mv moves-and-shows/public .
    git mv moves-and-shows/src .
    git commit -m 'move public and src to root'
    

    对于其他文件,它也应该可以工作。

    我确实希望您还必须修复硬编码路径(将 moves-and-shows/public 替换为 public 等等)。

    【讨论】:

      猜你喜欢
      • 2017-05-29
      • 2014-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-19
      • 2022-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多