- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在我的点文件的 git 存储库上有两个分支,master
和 kimura
以及 GitLab 上的远程设置。如果我检查任一分支和 git push
我被告知我是最新的...
$ git checkout master
Already on 'master'
$ git push
Everything up-to-date
$ git checkout kimura
Switched to branch 'kimura'
$ git push
Everything up-to-date
我已经对分支 kimura
进行了更改,并提交并 merge 了 pull-requests 到 master,然后使用...将 kimura
与 master merge
$ git checkout kimura
Switched to branch 'kimura'
$ git merge origin/master
Already up to date.
但是我有电力线提示(在 ZSH 下)并且都显示我已经提交等待被推送并且当我查看历史时它显示两个分支的 origin
都在 头
...
* ef61530 - (HEAD -> kimura) Resolving conflict to merge master into kimura (2019-01-26) <slackline>
|\
| * 1ece19c - (origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (2019-01-18) <slackline>
| * 80efc48 - Merge branch 'kimura' into 'master' (2018-12-17) <nshephard>
| |\
* | | f32a089 - tweaking virtualenvwrapper.sh path for new host (2019-01-24) <slackline>
* | | d2ccb42 - Tweaking specifics for work machine. (2019-01-24) <slackline>
* | | 13fc696 - Updates to a few files (2019-01-24) <slackline>
* | | a453190 - Added gnupg to link section (2019-01-23) <slackline>
* | | c7da4ac - Added todo task and display of warnings at end of setup (2019-01-23) <slackline>
* | | 07f313b - Added gnupg (2019-01-23) <slackline>
* | | 20cf7f8 - Copying sample code from James (2019-01-23) <slackline>
* | | 4edf7b5 - updated path for /mnt/personal (2019-01-12) <slackline>
* | | 0b61635 - adding work_laptop profile (2018-12-19) <slackline>
* | | 71c7d3f - Adding config/.config/.pycodestyle (2018-12-18) <slackline>
| |/
|/|
* | 8ac383a - (origin/kimura) Starting off yapf config (2018-12-17) <slackline>
|/
* 3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (2018-12-10) <slackline>
我不确定如何让任一分支上的 origin
与 HEAD
保持一致,如果有任何建议/指点,我将不胜感激。
编辑:
根据@Tim Biegeleisen 的建议,我尝试了以下...
$ git fetch origin
From gitlab.com:nshephard/dotfiles
* branch master -> FETCH_HEAD
$ git checkout kimura
Switched to branch 'kimura'
$ git merge origin/master
Already up to date.
然后我尝试将 kimura
分支直接与 master
merge ...
$ git checkout origin/master
error: Your local changes to the following files would be overwritten by checkout:
gnupg/.gnupg/random_seed
Please commit your changes or stash them before you switch branches.
Aborting
$ git stash
Saved working directory and index state WIP on kimura: 8464bcc Merge
将'kimura'分支为'master'
$ git checkout origin/master
Note: checking out 'origin/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again.
Example:
git checkout -b <new-branch-name>
HEAD is now at 1ece19c Reinstated sourcing of virtualenvwrapper.sh on work host
...并且在分支 master
origin 仍然不是最新的 HEAD
因为我现在处于分离状态已经回到origin
并且有尚未 merge 的提交...
* 1ece19c - (HEAD, origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (Fri Jan 18 10:52:17 2019 +0000) <Neil Shephard>
* 80efc48 - Merge branch 'kimura' into 'master' (Mon Dec 17 18:10:50 2018 +0000) <nshephard>
|\
| * 8ac383a - (origin/kimura) Starting off yapf config (Mon Dec 17 17:15:42 2018 +0000) <slackline>
|/
* 3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (Mon Dec 10 10:41:47 2018 +0000) <slackline>
|\
| * 2e0a40e - Resolving conflicts in zsh/.zshrc (Mon Dec 10 10:35:45 2018 +0000) <Neil Shephard>
| |\
| | * 1b0a018 - Merge branch 'kimura' into 'master' (Thu Dec 6 10:22:25 2018 +0000) <nshephard>
| | |\
| * | | a6f3350 - Removing line that calls virtualenvwrapper on work computer (Mon Dec 10 10:32:47 2018 +0000) <Neil Shephard>
| |/ /
| * | fefb0b0 - Commenting out $PATH (Mon Dec 3 13:38:33 2018 +0000) <Neil Shephard>
| * | 2597385 - Merge branch 'kimura' into 'master' (Wed Nov 14 09:57:56 2018 +0000) <nshephard>
| |\ \
* | | | 69d1599 - Added port forwarding for mongodb to ds1 config (Fri Dec 7 10:33:52 2018 +0000) <slackline>
| |_|/
|/| |
...关于如何 merge 所有内容并使 origin
与 HEAD
内联,我再次感到困惑。
编辑 2:
根据@torek 的要求...
$ git rev-parse --abbrev-ref master@{upstream}
fatal: upstream branch 'refs/heads/master' not stored as a remote-tracking branch
我的 git 配置看起来像...
user.email=xxxxx@gmail.com
user.name=slackline
push.default=simple
credential.helper=cache
pack.window=0
pack.windowmemory=100m
pack.packsizelimit=100m
pack.threads=1
color.ui=auto
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@gitlab.com:nshephard/dotfiles.git
remote.origin.pushurl=git@gitlab.com:nshephard/dotfiles.git
remote.origin.push=+refs/heads/*:refs/heads/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master.pushremote=origin
submodule.tmux/.tmux/plugins/tpm.url=https://github.com/tmux-plugins/tpm
submodule.tmux/.tmux/plugins/tpm.active=true
submodule.oh-my-zsh/.oh-my-zsh.url=https://github.com/robbyrussell/oh-my-zsh
submodule.oh-my-zsh/.oh-my-zsh.active=true
submodule.emacs/emacs.url=git@gitlab.com:nshephard/emacs.git
submodule.emacs/emacs.active=true
submodule.emacs/.emacs.d.url=git@gitlab.com:nshephard/emacs.git
submodule.emacs/.emacs.d.active=true
submodule.fonts.url=https://github.com/powerline/fonts
submodule.fonts.active=true
branch.kimura.remote=origin
branch.kimura.merge=refs/heads/kimura
branch.kimura.fetch=+refs/heads/*:refs/heads/*
当前日志/图表看起来像...
* 564630f - (HEAD -> kimura, master) Merge branch 'kimura' into 'master' (Mon Jan 28 16:01:30 2019 +0000) <nshephard>
|\
| * c6c75ba - Updating to use RSA keys as seahorse doesn't like ed25519 keys (Mon Jan 28 16:00:35 2019 +0000) <slackline>
|/
* 8464bcc - Merge branch 'kimura' into 'master' (Sat Jan 26 09:32:05 2019 +0000) <nshephard>
|\
| * ef61530 - Resolving conflict to merge master into kimura (Sat Jan 26 09:30:54 2019 +0000) <slackline>
| |\
| | * 1ece19c - (origin/master) Reinstated sourcing of virtualenvwrapper.sh on work host (Fri Jan 18 10:52:17 2019 +0000) <Neil Shephard>
| | * 80efc48 - Merge branch 'kimura' into 'master' (Mon Dec 17 18:10:50 2018 +0000) <nshephard>
| | |\
* | | \ 6138abc - Merge branch 'kimura' into 'master' (Thu Jan 24 11:39:35 2019 +0000) <nshephard>
|\ \ \ \
| |/ / /
| * | | f32a089 - tweaking virtualenvwrapper.sh path for new host (Thu Jan 24 11:39:04 2019 +0000) <slackline>
| * | | d2ccb42 - Tweaking specifics for work machine. (Thu Jan 24 11:37:48 2019 +0000) <slackline>
| * | | 13fc696 - Updates to a few files (Thu Jan 24 07:09:41 2019 +0000) <slackline>
| * | | a453190 - Added gnupg to link section (Wed Jan 23 13:08:29 2019 +0000) <slackline>
| * | | c7da4ac - Added todo task and display of warnings at end of setup (Wed Jan 23 11:01:08 2019 +0000) <slackline>
| * | | 07f313b - Added gnupg (Wed Jan 23 10:58:22 2019 +0000) <slackline>
| * | | 20cf7f8 - Copying sample code from James Ridgway https://github.com/jamesridgway/dotfiles/blob/master/setup (Wed Jan 23 10:57:32 2019 +0000) <slackline>
| * | | 4edf7b5 - updated path for /mnt/personal (Sat Jan 12 07:55:45 2019 +0000) <slackline>
| * | | 0b61635 - adding work_laptop profile (Wed Dec 19 12:34:16 2018 +0000) <slackline>
| * | | 71c7d3f - Adding config/.config/.pycodestyle (Tue Dec 18 16:32:52 2018 +0000) <slackline>
| | |/
| |/|
| * | 8ac383a - (origin/kimura) Starting off yapf config (Mon Dec 17 17:15:42 2018 +0000) <slackline>
| |/
| * 3d6aac6 - Merge branch 'master' of gitlab.com:nshephard/dotfiles into kimura (Mon Dec 10 10:41:47 2018 +0000) <slackline>
最佳答案
我从未见过您执行 git fetch
或 git pull
,所以很可能您的本地分支与远程分支不同步。以下应该有效:
git fetch origin
git checkout kimura
git merge origin/master
git fetch
调用应该使用来自远程的最新更改更新您的本地跟踪分支 origin/master
。你也可以直接与 master
merge ,假设你已经 pull 了那个分支:
git checkout master
git pull origin master
git checkout kimura
git merge master
关于Git 起源在头后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54400086/
我的 FAB 将显示在 android studio 的设计窗口中,但在我实际运行应用程序时不会显示。 此外,我有一个 ListView 项目,我指定它应该位于工具栏下方,但当我运行该应用程序时,它部
我的Nginx服务器位于haproxy之后,后者位于Varnish之后: 请求网页=> Varnish => HaProxy => Nginx 我的问题是我无法检索客户端的IP地址,在Nginx日志中
我正在尝试在用户点击的图像上显示一些上下文信息。 我正在为此使用 vtkTextActor。我正在使用 python 绑定(bind)。 问题是因为它在图像上很难阅读,所以我想在它后面画一些背景。 (
我创建了一个 flutter 小部件,它由几个组成应用栏和选项卡的条子组成,在其下方,我有 TabBarView。 1) 选项卡和主体 ScrollView 之间有过多的填充,但我不确定是什么元素导致
当我在 Xcode 4.3.3 上运行我的 cocoa 应用程序时。使用 Lion 10.7.4。应用程序启动并出现在 Xcode 后面。前面几次出现,不知道发生了什么。有人遇到过这样的问题吗?我的主
我需要将一些文本相对于“dropzone”(div)水平和垂直居中放置。它适用于以下解决方案:Inject a text above a div centered horizontally and v
我正在尝试在列表上使用匹配的几何效果,并且至少对于详细 View 的动画来说,它的工作方式与预期的一样。问题是从详细 View 返回列表单元格的动画似乎在列表后面。 我怎样才能让它正常工作,以便详细
我正在尝试在列表上使用匹配的几何效果,并且至少对于详细 View 的动画来说,它的工作方式与预期的一样。问题是从详细 View 返回列表单元格的动画似乎在列表后面。 我怎样才能让它正常工作,以便详细
我对此有点挣扎。在对 Google 进行研究后,我创建了以下计时器例程,该例程在调用时效果良好 // play move method public static void playMove() {
我正在编写一款Android游戏,用户可以购买在购买后动态创建的建筑物。创建它们后,用户可以将它们拖放到任何想要的地方,只要它们在地面上即可。我将天空和地面作为两种不同的框架布局,但天空占据顶部的 2
我有一个包装 div,在那个 div 里面有一些带有下拉按钮的按钮,包装应该有一个最大高度和一个自动滚动。 问题是如果我点击一个按钮,现在下拉菜单总是放在包装器后面,有没有办法让下拉菜单放在包装器的顶
我在 Bootstrap 3 中有一个网站 http://213.239.217.181/carboot/ 我可能会被否决,因为人们会说你试过什么或向我们展示你试过的代码 但我已经为这个问题苦苦挣扎了
我似乎无法解决这个问题,我将标签栏高度从 viewWillLayoutSubviews() 调整为 60,但覆盖 View 似乎不承认调整后的高度并效仿. 我发现的其他类似问题实际上并不相似(请参见此
我在相对布局中有两个线性布局。每个线性布局中有三张图片。从而形成一个图片网格,其中三张图片水平放置在第一个线性布局中,三张在上面的第二个中。如下所示 我的网格 xml 代码是:
我一直试图在我的页面上获取多个背景图片,但我无法获取超过 2 个,所以我开始考虑我可以使用 div 代替。但是当我使用 div 时,我在屏幕的顶部和两侧留下了大约 5 个白色像素,直到我将位置更改为绝
我有一些关于 CSS 的问题。您可以查看以下链接: http://lookdemo.biz/webs/chirag/mickes_figurer/ 在那里,您会在文本“NYFÖDDA FIGURER”
我有一个问题,我有一个绝对定位的 div,它充当背景图像顶部的颜色叠加层。 我遇到的问题是这个绝对定位的 div 之后的所有内容都放在它后面而不是在它上面。我不太明白发生了什么事。我知道它必须简单。
我知道这是一个热门话题,但我浏览了很多论坛,但没有一个修复对我有用。我有一个下拉菜单,隐藏在我正在显示的 pdf 后面。我尝试将 pdf 设置为嵌入并将其设置为 iframe。我尝试更改 css 中的
我不确定我是否在这里遗漏了什么,但似乎我无法将图像映射放在其他所有内容之上(就 z-index 而言)。我尝试改变 HTML 元素定义的顺序,我尝试使用 CSS 来定义适当的 z-index 值,但这
我有一个使用来自 slideful.com 的 iframe 的幻灯片。 slideful 的幻灯片使用 jquery。将幻灯片放在主页上后,我在导航中添加了一个下拉菜单,它位于“slideful.c
我是一名优秀的程序员,十分优秀!