常用命令
git clone ${url} 克隆遠程庫到本地
git status 查看當前狀態(tài)
git remote -v 查看遠程庫地址
git remote add ${遠程庫名稱} ${遠程庫地址} 添加遠程庫
git branch 查看分支
git checkout -b ${name} 創(chuàng)建新的分支并切換過去
暫存功能git stash
git stash 暫存當前修改未提交的代碼
git stash pop 將最新暫存的一版代碼 拿出來
git stash list 查看暫存列表 先進后出 后進先出
git stash drop 不需要的暫存可直接刪除
gitignore更改后生效
git rm -r --cached . #清除緩存
git add . #重新trace file
git commit -m "update .gitignore" #提交和注釋
git push origin master #可選,如果需要同步到remote上的話
git配置
-- 修改全局git 提交信息
git config --global user.name "xxx"
git config --global user.email "xxxx"
-- 修改局部git 提交信息
git config --local user.name "xxx"
git config --local user.email "xxxx"
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。