Pushing existing git repository to gitolite
Using the information provided by User1578, I was able to add an existing repo to my development server's gitolite repo.
Steps involved:
- Added the repo and pub key (if necessary) to gitolite
- Edited the local .git/config
- changed the
[remote "origin"]
url
to my gitolite repo.
- changed the
git push origin master
Your set up may be different, but I did not need (or want) another branch/remote. The old origin remote was dead anyway, so I did not need to keep it. Hope this helps someone else.
- Create new ("bare" is the default in gitolite) repository (with the same name or with a new name as you wish)
- Clone the repository that you want to import
Open CLI in the cloned repository and change the remote url. e.g:
git remote set-url origin [email protected]:YOUR_NEW_REPO
Run:
git push
You need to add another remote to your existing repository:
git remote add newremote [email protected]:gitolite_repo
These values will be changed to suit your needs:
- newremote is the name of the new remote (it's like origin, which you've already been using.)
- git is the username
- gitolite.com is the server
- gitolite_repo is the repo inside gitolite you want to use
When you want to push to origin, you can do that as you always have. When you want to push to the new remote you just do:
git push newremote branch