git config全局配置及部分常用命令


1、在開發過程中,切換分支經常用到 【git checkout release】

所以為了快捷開發、提高效率,可以把checkout 設置為co

就可以用這個【git config --global alias.co 'checkout'】(其中綠色部分是變化的,根據不同需求可配置的)

 

另外 --global選項是針對所有用戶都起作用的,會在~/.gitconfig文件中寫入信息。

用【git config --list】可以查看配置列表

 

2、如果你要查看文件的某個部分是誰修改的, 那么就用 git blame 

git blame -L 11,+1 --filepath

"-L"參數在命令(blame)中指定開始和結束行:

filepath”是指文件路徑

git show 73a69ac1 --filepath

 

3、使用git 出現 

GitLab: Your account has been blocked.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

無法從遠程pull/push代碼下來,

解決方案如下:

git 重新設置下遠程url即可

$ git remote set-url origin git@yourhost.com:org/project.git


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM