git

拉取代码

$ cd  f:/mall/git

 

$ git clone https://git.paas.sinopec.com/N0098007WSHOP/eshop-product.git

 

提交代码

$ cd eshop-product/eshop-product-api/

$ git add -A

$ git commit -m "mall"

git push

git push -u origin master

删除远程代码

# [git删除远程仓库的文件或目录]

git rm -r --cached .error        //删除.error目录下

git rm -r --cached error/a.txt    //删除error目录下的a.txt文件  

git rm -r --cached error        //删除error目录

git commit -m "删除a目录下的2.txt文件"

git push

物理删除本地

代码合并—将dev合并到master

lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmalldev/gitshop/eshop-product (dev)
$ git pull   //先在dev获取最新代码,否则会报Already up to date
 lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmall/eshop-product (dev)

$ git checkout master

Switched to branch 'master'

Your branch is behind 'origin/master' by 12 commits, and can be fast-forwarded.

  (use "git pull" to update your local branch)

 

lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmall/eshop-product (master)

$ git pull 

Updating f39a033..251abce

Fast-forward

 eshop-product-api/mall-admin/pom.xml               |    4 +-

 .../controller/PmsProductStninfoController.java    |   72 +

 

lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmall/eshop-product (master)

$ git merge dev

 

*** Please tell me who you are.

 

Run

 

  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"

 

to set your account's default identity.

Omit --global to set the identity only in this repository.

 

fatal: unable to auto-detect email address (got 'lql@CFI-87RQ6ULKJ6H.(none)')

 

在.git/config文件中添加信息

[user]

email=qinglin.li@pcitc.com

name=qinglin.li

 

lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmall/eshop-product (master)

$ git merge dev

Auto-merging eshop-product-api/mall-mbg/src/main/resources/com/macro/mall/mapper/PmsStninfoMapper.xml

CONFLICT (content): Merge conflict in eshop-product-api/mall-mbg/src/main/resources/com/macro/mall/mapper/PmsStninfoMapper.xml

Auto-merging eshop-product-api/mall-

CONFLICT (content): Merge conflict in eshop-product-api/mall-admin/pom.xml

Automatic merge failed; fix conflicts and then commit the result.

 

lql@CFI-87RQ6ULKJ6H MINGW64 /d/mall/gitmall/eshop-product (master|MERGING)

$

解决冲突

 

 

git pull origin master

 

 

 

git clone https://git.paas.sinopec.com/N0098007WSHOP/eshop-zuul.git
cd eshop-zuul
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

 

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值