拉取代码

$ 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

 

 

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐