git 笔记

#----------------------------------------------------------------------

#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"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值