第27月第24天 git pull fetch
1.
在进行 pull 操作的同时,其实就是 fetch+merge 的一个过程。我们从 remote 分支中拉取新的更新,然后再合并到本地分支中去。
- 如果 remote 分支超前于本地分支,并且本地分支没有任何 commit 的,直接从 remote 进行 pull 操作,默认会采用
fast-forward模式,这种模式下,并不会产生合并节点,也就是说不会产生多余的那条 log 信息 - 如果想之前那样,本地先 commit 后再去 pull,那么此时,remote 分支和本地会分支会出现分叉,这个时候使用 pull 操作拉取更新时,就会进行分支合并,产生合并节点和 log 信息。这两种状态分别如下图所示:
为了去除自动生成的 log 信息,有以下几种解决方案:
- 如果你使用的是 Git Bash,直接使用
git pull --rebase。如果拉取不产生冲突,会直接 rebase,不会产生分支合并操作,如果有冲突则需要手动 fix 后,自行合并。 - 如果使用的是 GUI,例如 TortoiseGit,可以先 fetch,再手动 rebase 就可以了。
https://www.cnblogs.com/Sinte-Beuve/p/9195018.html
2.origin master
在clone完成之后,Git 会自动为你将此远程仓库命名为origin(origin只相当于一个别名,运行git remote –v或者查看.git/config可以看到origin的含义),并下载其中所有的数据,建立一个指向它的master 分支的指针,我们用(远程仓库名)/(分支名) 这样的形式表示远程分支,所以origin/master指向的是一个remote branch(从那个branch我们clone数据到本地),但你无法在本地更改其数据。
同时,Git 会建立一个属于你自己的本地master 分支,它指向的是你刚刚从remote server传到你本地的副本。随着你不断的改动文件,git add, git commit,master的指向会自动移动,你也可以通过merge(fast forward)来移动master的指向。
$git branch -a (to show all the branches git knows about)
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
$git branch -r (to show remote branches git knows about)
origin/HEAD -> origin/master
origin/master
可以发现,master就是local branch,origin/master是remote branch(master is a branch in the local repository. remotes/origin/master is a branch named master on the remote named origin)
$git diff origin/master master (show me the changes between the remote master branch and my master branch).
需要注意的是,remotes/origin/master和origin/master的指向是相同的
$git diff origin/master remotes/origin/master
git push origin master
origin指定了你要push到哪个remote
master其实是一个“refspec”,正常的“refspec”的形式为”+<src>:<dst>”,冒号前表示local branch的名字,冒号后表示remote repository下 branch的名字。注意,如果你省略了<dst>,git就认为你想push到remote repository下和local branch相同名字的branch。听起来有点拗口,再解释下,push是怎么个push法,就是把本地branch指向的commit push到remote repository下的branch,比如
$git push origin master:master (在local repository中找到名字为master的branch,使用它去更新remote repository下名字为master的branch,如果remote repository下不存在名字是master的branch,那么新建一个)
$git push origin master (省略了<dst>,等价于“git push origin master:master”)
$git push origin master:refs/for/mybranch (在local repository中找到名字为master的branch,用他去更新remote repository下面名字为mybranch的branch)
$git push origin HEAD:refs/for/mybranch (HEAD指向当前工作的branch,master不一定指向当前工作的branch,所以我觉得用HEAD还比master好些)
$git push origin :mybranch (再origin repository里面查找mybranch,删除它。用一个空的去更新它,就相当于删除了)
https://www.cnblogs.com/MarkTang/p/5759554.html
3.lipo -create
打开控制台输入 lipo -create iphoneos下frameworkTest的路径 simulator下frameworkTest的路径 -output 新的路径,这样就完成了模拟器和真机版本的合并,新路径下的frameworkTest就是你合并后的文件,将这个文件名字改成和你未合并之前的Test一样的名字,放到framework文件夹下,替换掉原来的frameworkTest文件。
https://www.cnblogs.com/oc-bowen/p/7478461.html
第27月第24天 git pull fetch的更多相关文章
- 第23月第24天 git命令 .git-credentials git rm --cached git stash clear
在git push的时候,有时候我们会想办法撤销git commit的内容 1.找到之前提交的git commit的id git log 找到想要撤销的id 2.git reset –hard id ...
- Git pull 强制覆盖本地文件 - CSDN博客
Git pull 强制覆盖本地文件 原创 2015年11月16日 22:07:56 标签: git git fetch --all git reset --hard origin/master git ...
- linux ,mac连接, git pull error, chmod修改文件的权限/chown修改文件和目录的所有者
去项目目录下 启动服务 setsid npm start & Mac下如何用SSH连接远程Linux服务器 https://www.cnblogs.com/littleBit/p/536280 ...
- 使用 expect 重启失败的 git pull/push 操作
问题的提出 最近使用 github 上传.下载项目代码时,经常会卡很久,有时候在命令行打了 git push 然后就去上厕所了,结果等我回来的时候,发现 push 早已经失败了,还得重新提交一下.如果 ...
- git pull和git fetch的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge Git fetch origin master git log ...
- 聊下git pull --rebase
有一种场景是经常发生的. 大家都基于develop拉出分支进行并行开发,这里的分支可能是多到数十个.然后彼此在进行自己的逻辑编写,时间可能需要几天或者几周.在这期间你可能需要时不时的需要pull下远程 ...
- Git fetch和git pull的区别
Git中从远程的分支获取最新的版本到本地有这样2个命令:1. git fetch:相当于是从远程获取最新版本到本地,不会自动merge git fetch origin mastergit log - ...
- git pull 冲突解决
这个意思是说更新下来的内容和本地修改的内容有冲突,先提交你的改变或者先将本地修改暂时存储起来. 处理的方式非常简单,主要是使用git stash命令进行处理,分成以下几个步骤进行处理. 1.先将本地修 ...
- git pull 然后 ahead of origin/master * commit 消失
本来显示 your branch is ahead origin/master * commit后来也许在master merge 这个分支后, 然后git pull, 就显示Your branch ...
随机推荐
- django(八)之数据库表的一对多,多对多表-增删改查
单表操作 表记录的添加 方式一: Book() b=Book(name="python基础",price=99,author="yuan",pub_date=& ...
- 初识JSP知识
一.jsp概述 JSP全称是Java Server Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术. JSP实际上就是Servlet. jsp = html ...
- SpringBoot+Shiro+Redis共享Session入门小栗子
在单机版的Springboot+Shiro的基础上,这次实现共享Session. 这里没有自己写RedisManager.SessionDAO.用的 crazycake 写的开源插件 pom.xml ...
- 关于 C# 中 Dictionary与Hashtable的性能测试
https://www.cnblogs.com/qianxingdewoniu/p/5266243.html
- IIS 错误:处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipelineHandler”
导致这种问题的原因是ASP.NET没有成功注册到IIS中,很有可能是先安装.Net Framework,然后安装IIS.为了避免此问题发生,要先安装IIS再安装.Net Framework. 解决方案 ...
- opencv: 基本知识(二);
1.Mat与IplImage之间的相互转换: //IplImage—>Mat //EXAMPLE: //浅拷贝: IplImage* pBinary=cvLoadImage("c:// ...
- 洛谷P1228 分治
https://www.luogu.org/problemnew/show/P1228 我真傻,真的,我单知道这种题目可以用dfs剪枝过,没有想到还能构造分治,当我敲了一发dfs上去的时候,只看到一个 ...
- python OrderDict
# encoding: utf-8 import csv import collections d = {'banana':3,'apple':4,'pear':1,'orange':2} print ...
- 云计算虚拟机技术-KVM安装
云计算虚拟机技术-KVM安装 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 身为运维的小伙伴估计大家都清楚KVM,因为在CentOS里面KVM还算很折腾的一个软件,早期CentOS ...
- slave have equal MySQL server UUIDs
在部署MySQL主从复制架构的时候,碰到了"Last_IO_Error: Fatal error: The slave I/O thread stops because master and ...