欧阳简之 > Git命令行指令

热爱代码,对每一行代码保持一颗敬畏之心。

Git 全局设置

git config --global user.name "oyjz"
git config --global user.email "503ouyang@sina.com"

创建新版本库

git clone https://gitlab.niaoyun.com/oyjz/test.git
cd test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

已存在的文件夹

cd existing_folder
git init
git remote add origin https://gitlab.niaoyun.com/oyjz/test.git
git fetch origin master
git checkout -b master origin/master
git pull origin master
git add .
git commit -m "Initial commit"
git push -u origin master

已存在的 Git 版本库

cd existing_repo
git remote add origin https://gitlab.niaoyun.com/oyjz/test.git
git push -u origin --all
git push -u origin --tags
tagged by none