0

I have a GitHub repository named Coursework. Also, I have another repo named ProjectA. Both repos have a history of commits that I would like to keep, but I want to add ProjectA into Coursework.

Is there a way to commit the changes in Coursework, but also keeping the commit history from Projects.

Let's say Coursework have the following commits

1. Initial commit
2. Add homework 1

And ProjectA have the following commits.

1. Create project folder
2. Update project.rb

So now, after I put the project folder into coursework, I would like all 4 commits to show up in the coursework commit history.

Is that possible? I looked into submodules and it does not seem like what I am looking for.

davidhu
  • 9,523
  • 6
  • 32
  • 53

1 Answers1

0

If you want to merge project-a into project-b:

cd path/to/project-b git remote add project-a path/to/project-a git fetch project-a git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge git remote remove project-a

It is a duplicate question found here. Gotta give credit to Andresch Serj for the answer

Community
  • 1
  • 1
BrianH
  • 16
  • 2