<h2>
git init
git remote add origin **
git pull origin master//master
git log
git commit -m "**"
git reset --hard **
git checkout master//切換的master分支
git merge develop//合并
</h2>
<h2>
作業區提交到暫存區
git add xxx :指定檔案提交到暫存區
git add . :全部提交到暫存區,包含修改和增加的,但不包含洗掉的
git add -u:全部提交到暫存區,包含修改和洗掉的,但不包含新增的
git add -A:. 并且 -u
暫存區提交到歷史區
git commit :提交到歷史區(此提交方式注意:需要備注操作資訊)
git commit -m 'xxx' (操作描述):提交到歷史區
git log : 查看提交記錄
git reflog :查看所有歷史記錄
查看每個區代碼區別
git diff :作業區 和 暫存區
git diff --cached :暫存區 和 歷史區
3、提交到 github 上(遠程有倉庫)
git remote -v :查看所有關聯資訊
git remote add xxx[ 遠程倉庫 git 地址 ] :建立關聯
git remote remove xxx[ 默認名:origin 可自定義 ] :移除關聯
4、拉取
前面說了,遠程有倉庫,提交之前先拉取遠程倉庫
git pull origin(默認名) master
5、提交
正式提交
git push origin master
</h2>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/235092.html
標籤:其他
