相关疑难解决方法(0)

在git中,merge --squash和rebase之间有什么区别?

我是git的新手,我正在努力理解壁球和篮板之间的区别.根据我的理解,你做一个篮板时做一个壁球.

git merge rebase git-rebase squash

336
推荐指数
5
解决办法
13万
查看次数

将我的所有提交压缩为一个用于GitHub pull请求

我在GitHub上发了一个pull请求.现在,存储库的所有者正在说要将所有提交压缩成一个.

当我键入git rebase -iNotepad打开时,其中包含以下内容:

noop

# Rebase 0b13622..0b13622 onto 0b13622
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit's log message
#  x, exec = run command (the rest of the line) using shell
#
# …
Run Code Online (Sandbox Code Playgroud)

git github squash pull-request

53
推荐指数
4
解决办法
4万
查看次数

想要在github中压缩多个提交

我想用提交消息"first"和"second"来压缩两个最新的提交.首先我拉主人然后我使用命令

git rebase -i HEAD~2 master
Run Code Online (Sandbox Code Playgroud)

它向我展示了这样一个编辑器中的两个提交:

pick first
pick second
Run Code Online (Sandbox Code Playgroud)

然后我将此编辑器更改为:

pick first
squash second
Run Code Online (Sandbox Code Playgroud)

保存更改后,我收到此消息:

Successfully rebased and updated refs/heads/master.
Run Code Online (Sandbox Code Playgroud)

它确实改变了远程主人的任何东西.要应用这些更改,我使用该git push命令并收到以下错误:

To https://github.com/aneelatest/GITtest.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/test/GITtest.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' …
Run Code Online (Sandbox Code Playgroud)

github

7
推荐指数
1
解决办法
1841
查看次数

标签 统计

git ×2

github ×2

squash ×2

git-rebase ×1

merge ×1

pull-request ×1

rebase ×1