git日常命令

克隆项目:git clone addr dir

切换分支,分支并没有 git checkout -b production origin/production
分支已存在,单纯切换分支 git checkout  branch_name  

更新 git pull
更新其他分支的文件 git checkout origin/production -- file1  file2

重置本地分支 git reset --hard  remotes/origin/production
删除分支 git branch  -D remotes/origin/production
删除远程不存在的本地分支git remote prune origin

更新某些文件到某个版本  git checkout 2efe37c8d18ab44fe79151c110b777241f7870f3 -- pc/common/header/head.html 不用管分支,只要找commit

查看不同分支某个文件的差异 git diff branch1 branch2 -- file
查看本地和参考的区别 git diff HEAD  file

提交命令
git branch --set-upstream master origin/master
git add -A
git commit -a
git push

迁移git仓库
git remote set-url origin ssh://git@gitlab.aipai.com:2224/front/AipaiPlatformTemplates.git

git内存不够导致pull push失败问题
./git/config
[core] packedGitLimit = 128m packedGitWindowSize = 128m [pack] deltaCacheSize = 128m packSizeLimit = 128m windowMemory = 128m

git设置当前分支未默认push分支
git config --global push.default "current"

  

转载于:https://www.cnblogs.com/zenghansen/p/7267598.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值