我在一家分店工作,结果搞砸了。我做了一些本地更改,我试图将这些更改和这个提交放到一个PR中,但是如果不从分支进行更新,我就不能这样做,因为它们不知何故变得不同步了。所以每当我运行git status时
Your branch and 'origin/myChanges' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
所有我尝试过的git拉只是吹走了我所有的改
我有一个超然的头在git。我对提交或保存任何更改不感兴趣,我只想转到我的分支的头部位置。我试过他的命令,但不起作用:
git checkout MyBranch
有什么帮助吗?
-更新
当我尝试结账时,我收到了这样的消息:
$ git checkout -f master
Switched to branch 'master'
Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.
-更新2它说这些是一些变化,我如何删除它们?
$ git merge o
在提出问题之前,我想知道我对Git概念的理解是否正确,请随时纠正我:
分支名称指向分支的提示(即结束提交),以及
头指向当前分支的分支名称,以及
当前分支被定义为签出到工作目录中的分支。
以下是我的问题:
当通过git命令将新提交添加到分支时(任何可以将提交添加到分支的git命令),
问题:
git命令是否总是将分支名称向前移动以指向新提交?还是有git命令将新提交添加到分支,这些命令不移动分支名称,因此需要运行其他git命令来移动它?
什么时候
- a new commit is added to **the current branch** by a g
我得到了以下错误。如何解析?:git add。git提交-m 't‘git推送源开发
To git@github.com:myrepo.git
! [rejected] development -> development (non-fast-forward)
error: failed to push some refs to 'git@github.com:myrepo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge th
老实说,我不太懂git,而且我甚至开始讨厌尝试使用它。
我正在尝试将项目的新版本推送到远程存储库(git push origin master),但是当我这样做时,我会得到这样的消息:
Error: failed to push some refs to 'myRepo'. Updates where rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes (e.g. git pull ...) before pu