git - 命令

  • 安装后

git config --global user.name “dengyifei”
git config --global user.email "540015260@qq.com"

  • junior use

git add file1 file2
git commit -m “提交说明”

  • show current workdir status

git status
git diff file
git diff HEAD --file

  • history log

git log
git log --pretty=oneline

  • return history version

git reset --hard HEAD^
git reset --hard version number

  • undo modification

git checkout – file
用版本库里的文件替换工作区git

  • SSH

ssh-keygen -t rsa -C "260721762@qq.com"
git remote add origin git@github.com:xxxx/xxxx.git
git push -u origin master

  • 分支

git branch
git checkout -b
git branch
git checkout
git branch -d
git push origin --delete
git branch --set-upstream branch-name origin/branch-name
git checkout – file
git checkout -b branch-name origin/branch-name

  • 合并

git merge --no-ff -m “”
git log --graph --pretty=oneline --abbrev-commit

  • 检出远程分支

git remote -v
git checkout -t origin/hello-edits

  • 防止LF换行被替换

git config --global core.autocrlf false

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值