Toc
  1. Git
    1. git中 pull和fetch的区别
Toc
0 results found
Goblin
Git指令
2020/03/30

Git

  1. 从jd-dev拉取代码
git clone -b jd-dev http://192.168.8.134/neuhive-silver/neuhive-silver-platform.git
  1. 切换分支
git checkout -b newIssues
  1. 拉取jd-dev代码覆盖本地
git reset --hard orgin/jd-dev
  1. 添加, 提交, 推送
git add .
git commit -m '#issuesName'
git push --set-upstream orgin issuesName
  1. New Merge Request

git中 pull和fetch的区别

使用git 直接提交的话 直接 push

获取最新版本 有两种 拉取 和 获取 pull 和 fetch

git pull 从远程拉取最新版本 到本地 自动合并 merge git pull origin master

git fetch 从远程获取最新版本 到本地 不会自动合并 merge git fetch origin master git log -p master ../origin/master git merge orgin/master

实际使用中 使用git fetch 更安全 在merge之前可以看清楚 更新情况 再决定是否合并

打赏
支付宝
微信
本文作者:Goblin
版权声明:本文首发于Goblin的博客,转载请注明出处!