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
