1

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.

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
BJha
  • 73
  • 1
  • 4
  • 1
    Anything apart from this? https://gist.github.com/martinbuberl/b58fd967f271f32f51f50aee62e7332c – BJha Mar 13 '19 at 11:45
  • You can pull project from first source then you can push to second source – Beyazid Mar 13 '19 at 11:50
  • 3
    Possible duplicate of [How to import existing Git repository into another?](https://stackoverflow.com/questions/1683531/how-to-import-existing-git-repository-into-another) – Nino Filiu Mar 13 '19 at 12:26

2 Answers2

1

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
Manohar
  • 22,116
  • 9
  • 108
  • 144
  • Any idea how to manage/best practice of keeping the multiple repositories(Microservices) in GitHub – Girish Jul 15 '21 at 16:18
0

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