當(dāng)前位置:
首頁(yè) >
git 命令使用技巧
發(fā)布時(shí)間:2025/3/16
36
豆豆
生活随笔
收集整理的這篇文章主要介紹了
git 命令使用技巧
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.如果使用htts協(xié)議,需要執(zhí)行初始化命令,并保存賬號(hào)密碼
保存賬號(hào)密碼 git config --global credential.helper store 取消ssl驗(yàn)證 git config --global http.sslVerify false 忽略文件夾權(quán)限 git config core.filemode false2.切換到本地沒有而遠(yuǎn)程服務(wù)器有的分支
git fetch --all git checkout -f branch_name3.代碼回滾
git reset --hard the_commit_id --回滾到某commit_id的版本4.放棄所有本地修改,跟遠(yuǎn)程服務(wù)器保持一致
git reset --hard origin/branch_name5.查看所有分支
git branch -a6.查看代碼倉(cāng)庫(kù)地址
git remote -v7.修改遠(yuǎn)程倉(cāng)庫(kù)地址
git remote set-url origin remote_url8.查看歷史commit信息
git log git log --stat #顯示近幾次提交更新文件的內(nèi)容。(可顯示最近提交人) git log --pretty=oneline --stat #僅僅顯示最近提交更新的內(nèi)容(不顯示最近提交人)9.創(chuàng)建新的分支
git branch branch_name git checkout -b branch_name10.從一個(gè)分支推送到另外一個(gè)分支
git push origin branch_name_a:branch_name_b?
轉(zhuǎn)載于:https://www.cnblogs.com/Mr-Echo/p/9827804.html
總結(jié)
以上是生活随笔為你收集整理的git 命令使用技巧的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 返回一个二维整数数组中最大子数组的和
- 下一篇: 004-2-拟合,drop-out