简体   繁体   中英

How to push same code in different repositories on github using gitbash

I have created repository xyz in github and push the code using

git remote add origin git@github.com:user/ci.git

then

git push -u origin master 

Now code uploaded to ci directory successfully,then I created another directory abc in github and used the command

git remote add origin git@github.com:user/abc.git 

but got error

error: remote origin already exists.

I didn't understand why I can't make another copy to different repository in github

You can, but you must give another name to your remote, you can call it abc for example.

git remote add abc git@github.com:user/abc.git

# then
git push -u abc master

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