GIT 相关
Git 代码行统计:
git log --author="xxxxx" --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --since ==2020-04-1 --until=2020-04-1 --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
GIT 新建分支:
git checkout -b main_uat
git push origin main_uat
git branch --set-upstream-to=origin/main_uat main_uat
Git修改分支名称
场景:将分支名称为 oldbranch 改为 newbranch
步骤:
1、将本地分支oldbranch切一个分支到本地
git branch -m oldbranch newbranch
2、删除远程分支
git push --delete origin oldbranch
3、将本地新分支推送到远程
git push origin newbranch