Create a fresh bare repository on the server:
git init --bare newrepo.gitAdd it as a remote in our local repo:
git remote add newrepo git://user@server.com/newrepo.git
Push all branches:
git push --all newrepo
Notes on problems and solutions found while developing and goofing around, only technical and science stuff, no commercial pitchs, preaching or thought-leader crap, just hands-on stuff.
git init --bare newrepo.gitAdd it as a remote in our local repo:
git remote add newrepo git://user@server.com/newrepo.git
Push all branches:
git push --all newrepo
error: object file .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0 is empty fatal: loose object 3165329bb680e30595f242b7c4d8406ca63eeab0 (stored in .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0) is corrupt
cp -a .git .git-old git fsck --full # Remove empty files by using "rm", continue until none is left and the "missing blob" starts showing git reflog # It will show "fatal: bad object HEAD" tail -n 2 .git/logs/refs/heads/master # Identify parent of last commit (the one HEAD is pointing to), easily recognizable as it will show up twice git show commit_parent git update-ref HEAD commit_parent git fsck --full # There are some blobs left from outdated index, nuke and carry on rm .git/index git reset # There should be only references to "dangling blobs", these are not errors, continue git status git add . git commit -m "Recovering from lost objects"And done.
| Taken from @CommitStrip |
Edit .git/config and change the URL in svn-remote tag
git svn fetch
Edit again the .git/config file and replace the URL with the old one.
git svn rebase -l
Change (again) the URL at .git/config file to the new one.
git svn rebase.
Unable to determine upstream SVN information from working tree historyAs explained Here this will only works if the fetch command actually fetch anything, it was not my case, so I tried the following:
git svn info # double check UUID's
git config svn-remote.svn.rewriteRoot OLD_URL.
git config svn-remote.svn.url NEW_URL.
git svn fetch --parent.
git svn rebase.
Git-svn couples git commits to the origin SVN repository by embedding the original SVN url in the commit. Changing this url will change the Git commit SHA (basically rewrite all your history). Google results furnish various elaborate schemes for reconfiguring and patching up the Git repo, but the safest approach involves using built-in support for "rewriting" the Git-svn root url. This effectively tells Git to continue using the original SVN url for purposes of Git history, but use an independent URL (the new location) for actually retrieving and commit deltas (you will have to live with the old url in your commit history, but most likely you will be the only one that sees that).