Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

3 Answers 3

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

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
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://laptopserver.com/repos/git/job.git

third: config and push to new repository

cd /directory/job
git config -e

change the url from laptopserver.com to desktopserver.com

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.