0

I have created and worked on a git repository github.com/softtimur/old. I just created another git repository github.com/softtimur/Documents, which has its own .../Documents/.git/. Now I want to create .../Documents/old and move everything of github.com/softtimur/old under it while keeping the commit history. And then, I want to remove github.com/softtimur/old.

Does anyone know how to do this moving properly?

1 Answer 1

1

I would add another remote to your local checkout of github.com/softtimur/old to allow you to to merge them and then push the result back

git clone [email protected]/softtimur/old.git cd old git remote add new [email protected]/softtimur/Documents.git git fetch new git checkout master git merge new/master git push -u new master 
Sign up to request clarification or add additional context in comments.

3 Comments

In which local folder should I start doing this?
What folder you are in before the git clone doesn't matter, however, I assumed that there was a folder in [email protected]/softtimur/old.git called old, if there isn't you probably should make one, move all files to that folder and commit before your do the merge to simplify it
git checkout master returns Already on 'master' Your branch is up-to-date with 'origin/master'. git merge new/master returns Auto-merging README.md CONFLICT (add/add): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.