命令 git

gitlab初始化配置

Command line instructions
You can also upload existing files from your computer using the instructions below.
gitlab仓库配置
Git global setup

git config --global user.name "jiaming wan"
git config --global user.email "[email protected]"


新仓库
Create a new repository

git clone [email protected]:wanjiaming/composer.git
cd composer
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 [email protected]:wanjiaming/composer.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 [email protected]:wanjiaming/composer.git
git push -u origin --all
git push -u origin --tags

git 强制覆盖本地工作区的修改,方法如下:

git fetch --all
git reset --hard origin/master
git pull

猜你喜欢

转载自www.cnblogs.com/big-ming/p/12697800.html