setup git server ubuntu 14.04 lts

install git on both gitserver and client

ssh-copy-id the publickey from client to server
mkdir -p /files/webdir.git
cd /files/webdir.git
git init --bare
chown -R gituser:gituser /files/

##On client-A

git config --global user.name "Joe blog"
git config --global user.email "joe@example.com"

we create our local git repo on /developer/djangoproject

mkdir -p /developer/djangoproject
cd /developer/djangoproject
git init .
git remote add origin root@gitserver:/files/webdir.git

to edit >> git remote set-url origin root@gitserver:/files/webdir.git

echo "hello" > index.html
git add .
git commit -m "first commits"

git push origin master

    Counting objects: 3, done.
    Writing objects: 100% (3/3), 212 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To root@gitserver:/files/webdir.git
    * [new branch]      master -> master

   
### On client-B
git clone root@gitserver:/files/webdir.git OR
git clone root@192.168.100.221:/files/webdir.git




No comments:

Post a Comment