Answer a question

I had a bunch of files in a folder and i pushed the whole folder to a github repo.

Then, I said to myself, "I should have these files in seperate subfolders"...So, I made some subdirectories, committed the changes and pushed again.

Now, my remote repo has the subdirectories with all the files I separated, but it also has all the files in the top level directory in the repo!

How do I sync github to my local repo copy?

Answers

Chances are, you moved the files into the new directories, added the files at their destination, but you did not tell Git to remove the originals.

You can do so by typing git rm <file> for each of the files in the root directory which you'd like removed, or by typing git add -u will stage all of the changes (including deletions) and committing the results.

Logo

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!

更多推荐