2

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.

3 Answers 3

3

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.

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
1
  • Thanks sir. I want to setup a new git server without losing the histories.
    – Teifi
    May 27, 2013 at 1:01
0

[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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .