Helppi snippetit ja muut

  • Helppi snippetit ja muut

    Git: How to restore repository, from clone of it, that has all the version information intact. Step by step guide.

    This method requires that you have shell access to the git-server of your cloned repository you want to save.    Step 1: Gain access to git-server as git user. if you dont have such: then you can use any location you want for recreating the repository from wich you clone. just initialize the <somename>.git some where you have access to. Step 2: re-create *.git directories that you want to restore. they should be bare initialized mkdir <repository name>.git cd <repository name>.git git init –bare . git symbolic-ref HEAD refs/heads/master Step 3: clone the repository in question: git clone gitUser@gitServer:repo-name.git Step 4: check the configuration from .git/config. what you need to…