User Tools

Site Tools


setup_git_server

Create a Git Repository on the Server

arwillis@visionlab13-pc:~$ cd /var/lib
arwillis@visionlab13-pc:/var/lib$ sudo mkdir git
[sudo] password for arwillis: 
arwillis@visionlab13-pc:/var/lib$ sudo chown arwillis:arwillis git
arwillis@visionlab13-pc:/var/lib$ sudo chmod g+w git
arwillis@visionlab13-pc:/var/lib$ sudo chown arwillis:arwillis git
[sudo] password for arwillis: 
arwillis@visionlab13-pc:/var/lib$ cd git
arwillis@visionlab13-pc:/var/lib/git$ git init --bare test.git
Initialized empty Git repository in /var/lib/git/test.git/

Access the repository remotely

arwillis@Willis-Lenovo-pc:~/NetBeansProjects$ git clone ssh://arwillis@visionlab.uncc.edu:/var/lib/git/test.git
Cloning into 'test'...
arwillis@visionlab.uncc.edu's password: 
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
arwillis@Willis-Lenovo-pc:~/NetBeansProjects$

Using your repositories

I downloaded and use SmartGit from http://www.syntevo.com/smartgit/. I use this gui for managing my Git repositories.

I've noticed that bare repositories are not initialized with ANY branches (not even origin!). So from a git client one must clone the repository, create the origin branch on the server (remote) and commit files to that branch in the repository. Seems like it could have been easier had they simply made a default branch “origin” when a repo is initialized.

setup_git_server.txt · Last modified: 2015/08/21 23:37 by arwillis