Creating git server
configure global parameters.
$ git config --global user.name "Name"
$ git config --global user.email "email@example.com"
generate ssh key
$ ssh-keygen -t rsa -C "email@example.com"
create a user account for git
$ sudo adduser git
$ su git
$ cd ~
add public keys of users who need access to git
$ mkdir .ssh
$ cat /tmp/jishnu.pub >> ~/.ssh/authorized_keys
create git project
$ mkdir project.git
$ cd project.git
$ git --bare init
restrict git user to only doing git activities by changing shell to git-shell
$ which git-shell
$ sudo vim /etc/passwd
client side.
$ git init
$ git remote add origin git@server:project.git
$ git touch README
$ git add README
$ git commit -m 'initial commit'
$ git push origin master
Written by Jishnu
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#