Skip to content

SysAdminDocs/git-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

git-docs

Documentation of Interesting Git Things


##Merge One Repository into Another

There may be that odd scenario that you want to move code from one repository into another. I.e. moving a repo from SourceForge into GitHub, you can follow the following process.

This assume you've already created a project on GitHub

SourceForge Repository: http://git.code.sf.net/p/myUser/myProject

GitHub Repostiory: https://github.com/myUser/myProject

$ git clone https://github.com/myUser/myProject.git
$ git remote add other http://git.code.sf.net/p/myUser/myProject.git
$ git fetch other
$ git checkout -b other-master other/master
$ git checkout master
$ git merge other-master
$ git add -A
$ git commit -am "Merged from old repo"
$ git push -u origin master

Now you're done the origin now has the same code base including history as other

Releases

No releases published

Packages

No packages published