简体   繁体   中英

How to add one repository to another repository on Github?

How to add one repository to another repository on Github? I have one project workspace XXX and i have my own created repository YYY somewhere else, so i want to add that repo to that blank repo created.

Here is simple way I can think of

  1. Clone the xxx repository
  2. open it and delete .git folder
  3. open terminal and type git init
  4. type command git remote add origin GIT_URL_OF_YYY
  5. add , commit and push

You could do this with simple two steps :

  1. clone {current}
  2. push {new}

A. clone {current} git clone

  1. create local directory
  2. open terminal
  3. git clone ssh://john@example.com/path/to/my-project.git
  4. cd my-project

B. push {new} git push <remote> <branch>

  1. git remote add origin example.com/path/to/my-project.git
  2. git push origin master

    • you may face an error of repo{s} timing, so.. you may need to fore pushing
    • and you may face some other problems then you will just run git add . git commit -m "first lanuch" git push -u origin 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