jiduvah
jiduvah

Reputation: 5168

Remove Git Repo From 1 Folder and Add that Folder to Another Repo Git

I am working on a project which has it's own git repo, this one I would like to keep. However I used a library that I cloned from github. I cloned this into a subfolder of my project. So the folder structure is correct.

What would be the best way to remove the repo from the library and add the library to my own repo? I need to keep the history in my project but not in the library.

EDIT

I use Tower to manage git this shows the follow. I guess it being in a submodule is the problem. How to solve this?

enter image description here

Upvotes: 0

Views: 74

Answers (1)

Austin
Austin

Reputation: 85

You can just remove the .git folder that came with the library. This will loose all the history of the library from GitHub, but that seems to be what you want.

Assuming linux/osx:

cd /path/to/library/dir
rm -rf .git/

Once you have removed the GitHub repo, you can add it with just a normal git add:

cd /path/to/library/dir
git add .

Upvotes: 1

Related Questions