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