git init

Command line instructionsgit

Git global setup
git config --global user.name "理想"
git config --global user.email "exmyth@126.com"緩存

Create a new repository
git clone git@gitlab.beyond.cn:app/exmyth-water-ui.git
cd exmyth-water-ui
touch README.md
git add README.md
git commit -m "add README"
git push -u origin masterapp

Existing folder
cd existing_folder
git init
git remote add origin git@gitlab.beyond.cn:app/exmyth-water-ui.git
git add .
git commit -m "Initial commit"
git push -u origin mastergitlab

Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.beyond.cn:app/exmyth-water-ui.git
git push -u origin --all
git push -u origin --tagsfetch

 

 

Git回滾代碼到某個commitui

回退命令:
$ git reset --hard HEAD^ 回退到上個版本
$ git reset --hard HEAD~3 回退到前3次提交以前,以此類推,回退到n次提交以前
$ git reset --hard commit_id 退到/進到 指定commit的sha碼rem

強推到遠程:
$ git push origin HEAD --forceit

 

git fetch -p 能夠刪除緩存的遠程分支列表io

相關文章
相關標籤/搜索