Git的命令用的不多,经常忘,在这备份一下

139 阅读1分钟

Git 全局设置

git config --global user.name "XXX"
git config --global user.email "***e@sina.com"

创建新版本库

git clone http://hostname/name/projectname.git
cd project_name
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

已存在的文件夹或 Git 仓库

cd existing_folder
git init
git remote add origin http://hostname/name/projectname.git
git add .
git commit
git push -u origin master