Assuming you have checked out a copy of the subversion repository with your own local changes, probably the most straight-forward way to transition to git is to setup your own branch. (I'm going to use the command-line here, since the specifics can vary by GUI, but they all use the command-line tools underneath.)
- Make a local copy of the repository, either the main one or a fork. A fork is useful if you want to keep your changes on a remote server, but it's not required. For the official repository:
Code: Select all
git clone https://github.com/rheit/zdoom.git cd zdoom
- There have been changes made to the Git repository that aren't in SVN. We will create a new branch starting at the point where the SVN left off: This creates a new branch called "mybranch" that is currently just a copy of the repository as it was at the last commit to SVN. It also makes it the most currently "checked out" branch. (Note that Git checkout is not the same as SVN checkout! Git checkout is equivalent to both svn update and svn switch.)
Code: Select all
git checkout -b mybranch 2.7.0
- Now copy your files from your copy of the SVN repository to the Git directory. I believe the following will work with local changes: Otherwise, just copy the files by hand, being sure not to copy any .svn directories.
Code: Select all
svn export --force <path-to-svn-directory> <path-to-git-directory>
- If you added any files to your repository that weren't in the SVN, be sure and add them to the git repository as well:
Code: Select all
git add somenewfile1.cpp git add somenewfile2.cpp
- Now commit your changes so that they won't be lost when you switch to a different branch: The "mybranch" branch should now be an exact copy of what you had in your SVN directory.
Code: Select all
git commit -a -m "Initial import of my SVN changes"
- Since your personal branch doesn't have any of the changes that occurred since the switch to Git, merge them from master into your branch:
Code: Select all
git merge master
- Commit this merge, too:
Code: Select all
git commit -a -m "Update to current master"
Code: Select all
git checkout mybranch (if it's not checked out already)
git merge master
git commit -a -m "Sync with master"
Code: Select all
git checkout master
Code: Select all
git checkout mybranch