问题1 ! [remote rejected] (no new changes
- 描述:
! [remote rejected] <本地分支名>-> refs/for/<远程分支名>(no new changes)
admin@DESKTOP-XXX MINGW64 /d/Silicon/developer/sdks/gecko_sdk_suite/v2.7/app/build/Zigbee-Smart-Gate/GNU ARM v7.2.1 - Default - XXX(XXX)
$ git push comgerrit XXX:refs/for/XXX
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Processing changes: refs: 1, done
To ssh://170.170.X.X.X:X/rtos/XXX.git
! [remote rejected] syn_dev -> refs/for/zigbeegate_dev (no new changes)
error: failed to push some refs to 'ssh://170.X.X.X:X/rtos/XXX.git'
解决:执行git commit --amend
生成新的changeId,在此提交即可
问题:fatal: unable to checkout working tree
$ git config --global core.protectNTFS false
$ git config --global core.autocrlf false
$ git config --global core.quotepath false
问题:文件名大小写问题
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
超级管理员打开终端
PS C:\Users\lenovo> fsutil.exe file SetCaseSensitiveInfo "E:\doc\T40" enable
已启用目录 E:\doc\T40 的区分大小写属性。
PS C:\Users\lenovo>
添加分支名称
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo " ($branch)"
fi
}
export PS1='\u@\h \w\[\033[01;32m\]$(git_branch)\[\033[00m\] \$ '
更新子仓库URL
-
git submodule sync
技巧类
配置 ~/.gitconfig
文件
log && branch 别名
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
br = branch --sort=committername --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:iso8601)%(color:reset))'
- branch 可选参数
可以将 committerdate:short 替换为 committerdate:relative 或 committerdate:iso8601
git branch --sort=committerdate 正序
git branch --sort=-committerdate 倒序