Answer a question

I have cloned the code from one git repo of another person and now I want to commit the code to my git repo. How I can do this without copy-pasting post-checkout separately?

Any git reference would be more helpful.

Answers

Run the below commands in sequence:

  • git remote

Will get the current remote path

  • git remote remove <remote path>

So now your remote link will be deleted, now you can add your repo and commit your changes, anyway confirm whether the remote has been deleted using below command

  • git remote

Nothing should be displayed

  • git remote add origin <your git repo http path>

Now your repo will be added as git repo to this folder, so now push your code changes to the new repo using below command.

  • git push origin master
Logo

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

更多推荐