Пн, 5 февраля, 18:08

ubuntu git install and tips

Quick install ubuntu git server and prepare for work →

...


 # update packages

sudo apt-get update

 

# install gitolite server

sudo apt-get install gitolite3

 

# rename (not necessary) user gitolite3 to git

sudo usermod gitolite3 --login git

 

# clone git admin dir to your home account

cd ~

git clone git@172.16.0.100:gitolite-admin

 

# make changes in gitolite.conf — add new repo

```repo web-app

    RW+     =   admin```

    

# show status

git status

 

# add files to repo

git add -A .

 

# commit your changes

git commit -m 'Added new repo'

 

# for use simple git push

git config --global push.default simple

 

# push changes to repo

git push

 

All done, your repo is ready.

Now go to dir with your app.

 

cd ~/web-app/

 

# initialize dir for git

git init

 

# add url of «remote» repo

git remote add origin ssh://git@192.168.56.100:8822/web-app

 

# check it

git remote -v

 

# commit and push your repo

git status

git add -A .

git commit -m 'Initial commit'

git push --set-upstream origin master

 

# clone repo on desktop

git clone ssh://git@192.168.56.100:8822/web-app