How can I use GIT in my own server?

Howto use git with a server?

  • I have a server (Linux, Debian) and my client (Windows). Currently I just copy my files over ssh to the server. Now I want to be cool and use git. I am trying this for a long time now and I am not sure what my question is. I created repositories on server and client. Commited my files but failed to push/pull/clone with IDE/GUI/console. Finally I managed to clone from command line. Just to find out that push does still not work. Do I need a bare repository? Looks like bare repositories don't have any files so I need two repositories an my server? Do I have to make a manual checkout on the server every time? I thought I can just push it there...

  • Answer:

    The git community documentation extensively explains how to use a remote repository over ssh and how to set one up you should read the documentation. http://book.git-scm.com/4_setting_up_a_private_repository.html

PiTheNumber at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

Make sure you have correctly added "remote" if not then use "git add remote" command. Another possibility is that ssh keys. Make sure you have correctly configured ssh keys.

vpatil

You are not able to push in a non-bare repository in specific situations: A non-bare repository has always a working copy to work on. Let's assume the working copy is based on master. If you now want to push into master from another repository, git cannot push theses changes into the master, because the working copy bases on it. That's why you should use a bare repository: A bare repository is very small and easy to use, because you can push in it without any merging and checkout.

furtelwart

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.