常见的GIT命令

git help                                 #可查看git的常用命令
git config --global user.name "Your Name Here"           #设置commit的署名
git config --global user.email "your_email@example.com"      #设置commit的email
git config [--local|--global|--system] --list/-l          #查看本地的global信息
git config [--local|--global|--system] --unset[-all] user.name  #删除user.name信息。如果user.name对应多个值,可用unset-all来删除
git remote add XXX https://github.com/username/repo_name.git    #设置github的连接
git clone git:
//github.com/your_account/aimed_repo.git       #复制一个repo到本地
git remote -v                               #查看本地设置的url连接信息
git status                                 #查看当前工作的
branch git branch                             #查看本地所有的
branch git branch -a                           #查看远程的所有分支
git branch -d branch_name                        #删除本地branch_name这一分支
git push origin --delete branch_name                   #删除名为branch_name的远程分支
git checkout branch_name                         #切换到名为branch_name的分支上
git chechout -b branch_name                       #在本地新建一个名为branch_nam的分支
git diff test_branch_name                        #查看当前branch与test_branch_name中代码的区别
git mv filename newfilename                      #文件重命名
git push XXX branch_name                        #上传指定的branch到远端
git pull                                  #将远程上的版本与本地版本进行合并,相当于get fetch + git merge
git reset --hard                             #将刚才进行的git pull所进行的操作取消,恢复本地版本合并前的原貌
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值