分类: LINUX
2013-09-05 09:40:20
原文地址:linux 环境下git 命令小结。 作者:thomasnew
mkdir CloudNAT
cd CloudNAT
linux # git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached ..." to unstage)
#
# new file: CloudNAT/.classpath
# new file: CloudNAT/.project
linux # git commit
[master (root-commit) 8c10939] thomasnew add for CloudNAT
124 files changed, 6732 insertions(+), 0 deletions(-)
create mode 100644 CloudNAT/.classpath
create mode 100644 CloudNAT/.project
git config --global user.name "thomasnew"
git config --global user.email "thomasnew@company.com"
# git config --list
user.name=thomasnew
user.email=thomasnew@company.com
# 生成ssh公共密钥,加到remote server上
# ssh-keygen -t rsa -C "thomasnew@company.com" //生成pub key文件
# ssh-agent bash //设置agent
# ssh-add //把刚生成的文件add上
git remote add CloudNAT ssh://thomasnew@192.168.11.11:29999/projects/CloudNAT
linux # git remote -v
CloudNAT ssh://thomasnew@192.168.11.11:29999/projects/CloudNAT (fetch)
CloudNAT ssh://thomasnew@192.168.11.11:29999/projects/CloudNAT (push)
git push CloudNAT master
git clone ssh://thomasnew@192.168.11.11:29999/projects/CloudNAT ./CloudNAT
cd CloudNAT
git pull origin
git pull origin CloudNAT //同步远程主线的修改,合并到本地。