#----------------------------------------------------------------------
#save passwd
git config --global credential.helper store
git commit -m "code stype"
git commit --amend
#---------------------------------------------------------------
#add tag
git tag v1.17.4
git push origin --tags
git push origin denise
#----------------------------------------------------------------------------
#branch
1 先切换到别的分支: git checkout dev20180927
2 删除本地分支: git branch -d dev20181018
3 如果删除不了可以强制删除,git branch -D dev20181018
4 有必要的情况下,删除远程分支:git push origin --delete dev20181018
git checkout -b denise
git push origin denise
#------------------------------------------------------------------
git reset
显示冲突文件
git ls-files -u | cut -f 2 | sort -u
git difftool --cached
git merge --no-commit octopus_office
#----------------------------------------------------------
git 提交消息格式化
vim /root/.git_template
git config --global commit.template /root/.git_template
git config --global core.editor vim
git commit
#-------------------------------------------------
git remote add tmp ../XXXX/
git fetch tmp
git branch -a
git checkout -b XXXX tmp/XXXX
删除所以tag
git tag -l| awk '/v*$/ {print $1}' | xargs git tag -d
创建自己的tag
git tag -a v15.2.5 -m "merge 15.2.5"
git push origin --tags
#----------------------------------------------------
git删除/撤销远已经push到程服务器上某次代码提交
场景:不小心把一次错误的代码push到远程服务器上的分支上,需要立即删除/撤销这次代码提交。
具体方法,git命令:
git reset --hard <commit_id>
git push origin HEAD --force
避免出现不必要的merge
git config pull.rebase true
#---------------------------------------------------------------------------
将提交向其他分支进行合并
git cherry-pick f46a7741
#----------------------------------------------------------------------------
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
git config --global http.sslVerify "false"