Git global setup 全局设置
git config --global user.name "测试用户"
git config --global user.email "test@qq.com"
Create a new repository 创建一个新仓库
git clone http://192.168.1.100/myproject/test.git
cd test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Push an existing folder 推送一个已存在的文件夹
cd existing_folder
git init
git remote add origin http://192.168.1.100/myproject/test.git
git add .
git commit -m "Initial commit"
git push -u origin master
Push an existing Git repository 推送一个已存在的仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin http://192.168.1.100/myproject/test.git
git push -u origin --all
git push -u origin --tags
查看用户名和邮箱地址:
$ git config user.name
$ git config user.email
修改用户名和邮箱地址
$ git config --global user.name "xxxx"
S git config --global user.email "xxxx"