简体   繁体   中英

GIT Delete Repository and clone on local machine

I have a branch called *master on the local machine

and I have three repositories called:

  • /git/app
  • /git/framework
  • /git/site

On this local machine, there is a lot of problems with files, out of sync, etc. the decision has been made to just delete the /site directory and re -clone this from master. I am unsure how to do this.

通常,简单地rm -rf /my/git/repo然后git clone <wherever I want to clone from> /my/new/git/repo

I think this is what you want -

$ rm -fr /git/site
$ mkdir /git/site && cd /git/site
$ git init
$ git remote add origin git@github.com/org/repo.git
$ git pull origin master

your /git/site will now be reset to your master branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM