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