Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an old laptop IBM Z61t as my git server. I want to upgrade my laptop server to a desktop server(the laptop server will not use anymore).

how could I setup and migrate the git repositories to my desktop server without losing histories. It's quiet different from setting up a git server.

Thanks in advance.

share|improve this question

You can simply copy the directory with the normal filesystem tools, or run a git clone on the new machine to copy, since you seem to already have the exiting machine set up as a server.

share|improve this answer

If you don't want to setup a git server, simply do a bundle of your repo on your old laptop.

cd  /repos/git/job.git
git bundle create /repos/git/job.bundle --all

That will generate one file job.bundle, that you can copy (through any mean you want: USB key, ...) onto your other server.

Once copied, you can clone from that bundle (which acts as a git repo):

git clone --bare job.bundle  /repos/git/public.git
share|improve this answer
Thanks sir. I want to setup a new git server without losing the histories. – Teifi May 27 '13 at 1:01
up vote 0 down vote accepted

[for my own reference, just push to origin:git push origin master ]

first: initialize new repository at desktop server

mkdir /repos/git/job.git
GIT_DIR=/repos/git/job.git git init

second: clone the repository

git clone ssh://

third: config and push to new repository

cd /directory/job
git config -e

change the url from to

git push origin master
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.