将 Github 中的图像文件移动到文件夹

Aki*_*wan 5 git github

我正在将我的网站移至 Github Pages,但在未保留相同文件夹名称方面犯了一个错误。相反,我只是将每个文件上传到主存储库。我的存储库在这里:https : //github.com/akinhwan/akinhwan.github.io

我知道如何通过单击编辑图标并添加根名称和“/”来更改文本文件的文件目录。但是图像文件似乎没有这个选项。

我如何使用 github、git shell 或 github desktop 将我的许多图像文件移动到子文件夹 /img 以便我的 html 能够找到我的图像文件?

谢谢大家!

Can*_*rop 6

要使用命令行执行此操作git

  • 键入git clone https://github.com/akinhwan/akinhwan.github.io以下载存储库的本地副本,然后cd akinhwan.github.io进入该目录。
  • 创建一个img通过运行调用的目录mkdir img
    • Create extra directories in this way as necessary if you need to reorganize any other types of file.
  • Move the images into the new directory by running git mv *.jpg *.png *.gif img/
    • This can be done for individual files like git mv file.png destination/
  • Once you are happy with what you have moved (use a graphical file manager if necessary to review the locations of moved files, and use git status to see what you have changed), run git commit -m 'Move image files to /img' or similar to make a new commit which moves your files to their correct locations.
  • Push the commit to the repository on GitHub by running git push and entering your credentials.