创建Git服务器端仓库

sudo git config --global user.name "ubuntu"

sudo git config --global user.email [email protected]

sudo git config --global core.excludesfile ~/.gitignore

 

cd /home

创建生产目录

sudo mkdir product

创建仓库目录 

sudo mkdir repos

创建名为myapp的仓库

cd /home/repos

sudo mkdir myapp

cd myapp

git-init --bare

cd /home/product

sudo git clone ssh://[email protected]/home/myapp/.git #app in another machine#

sudo git remote rm origin

sudo git remote add origin /home/repos/myapp

然后修改下代码。。。

sudo git add .

sudo git commit -m "first commit"

sudo git push origin master

相关推荐