rebase

git - update fork's master & rebase my branch onto it?

强颜欢笑 提交于 2019-12-03 05:15:50
问题 I have forked a github project, then cloned it locally. I then made some changes in a new branch on my_github/the_project repo. I then added and committed the changes and pushed to my github repo and submitted a pull request. The owner has received my request and would like me to "rebase onto master" to get the latest changes. How do I do this? Initially I thought I could just git fetch and rebase master from within my current branch (as most posts I found advise...), but git fetch didn't do

Git: How to rebase and squash commits from branch to master?

我只是一个虾纸丫 提交于 2019-12-03 05:08:42
问题 I'm trying to rebase and squash all my commits from current branch to master. Here is what I'm trying to do: git checkout -b new-feature make a couple of commits, after it I was trying: git rebase -i master in this case commits will remain in new-feature branch git checkout master git rebase -i new-feature It gives me and edit window with noop message. I know about command: git merge --squash new-feature But I'm currently working on learning of rebase command. 回答1: When rebasing, Git will not

Recovering from a failed rebase

怎甘沉沦 提交于 2019-12-03 04:43:47
I'm using git svn to get some git goodness with the company-mandated svn server. I just had a rebase go horribly awry, and I"m trying to figure out the best way to recover. Here's what happened: To start with, I had this ---1 (master) \--B--C--D--E (feature/fix-widgets) So then I did git checkout master and then git svn rebase on master to pull down those commits. I did not anticipate any conflicts between my feature branch and the master, because the changes were in a totally different folder. So at this point, I think I have this: ---1--2--3--4 (master) \--B--C--D--E (feature/fix-widgets)

How to fix commit order in GitHub pull requests, broken by git rebase?

血红的双手。 提交于 2019-12-03 04:35:15
When I write code I break it into small logical changes that are easy and quick to review. To do so, I use git rebase -i (interactive) to squash, drop and change order of commits. I've noticed this sometimes leads to a different order of commits on a GitHub pull request (though the order is retained on the remote branch). For example, commit 1 commit 2 commit 3 might show up in the PR as: commit 3 commit 1 commit 2 I've searched the internet and only managed to find this GitHub help page: Why are my commits in the wrong order? Their answer: If you rewrite your commit history via git rebase or

How do I make git show diff when rewording a commit message during rebase -i?

谁都会走 提交于 2019-12-03 04:25:18
I always use git commit --verbose . Is there an equivalent option/setting that will make git show me the diff when I'm rewording a commit message during git rebase --interactive ? According to your answers in the comments, executing git diff HEAD^ will not help you, except you only want to rewored the last commit. But in this case a rebase is the wrong tool anyway. Instead you can simply do git commit --amend --verbose without changes in the index and then edit the commit message, having the diff view you are asking for. If you want to reword an older or multiple commit messages with having

Merging multiple branches with git

旧城冷巷雨未停 提交于 2019-12-03 03:43:50
问题 I have 2 local branches called "develop" and "master"; they are similar. On my company's server there's one "main" repo (production) and several branches that were made by other developers: $ git branch -a * develop master remotes/origin/HEAD -> origin/master remotes/origin/some-test remotes/origin/feature1 remotes/origin/feature2 remotes/origin/master How can I merge remotes/origin/feature1 and remotes/origin/feature2 into my local "master" branch, copy that all into "develop" and start

Gerrit always rebase before submit patchset to avoid a merge commit

依然范特西╮ 提交于 2019-12-03 03:17:49
I found that when clicking "Submit Patch Set" in the Gerrit web interface, it'll either simply add a commit to that branch, or create a merge commit if another commit was submitted just before. Example that creates 2 commit: The actual commit and a merge commit: User submits patchset A depending on commit O User submits patchset B depending on commit O Submit Patch Set A Submit Patch Set B --> Creates merge commit between O -> A and O -> B There is a "Rebase Change" button which is great but it means that to submit a patch set everyone should always do: Click Rebase Change Click Submit Change

Git interactive rebase no commits to pick

浪子不回头ぞ 提交于 2019-12-03 02:50:44
问题 I'm on master and I did rebase -i <my_branch> Got this: noop # Rebase c947bec..7e259d3 onto c947bec # # 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 <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails # # If you remove a line here THAT COMMIT WILL BE LOST. # However,

Git - Moving Pushed Commits to a Different Branch

老子叫甜甜 提交于 2019-12-03 02:40:46
问题 My boss decided recently to try out an outsourcing group "for increased capacity" as we modify an existing application to add new features. Despite my concern that the group he chose didn't seem to communicate well and wasn't asking enough questions to truly understand and be effective, we went with them anyway. We set them up to collaborate on our Git repository (hosted on GitHub). We created a branch just for them (TheOutsourcedBranch, we'll call it) and requested that they to do all of

Error with git rebase (“could not apply…”)

橙三吉。 提交于 2019-12-03 02:37:08
问题 I'm the administrator of the GitHub repository https://github.com/plison/opendial. I would like to reduce the number of commits on the repository, since the repository already has a few thousand commits, many of whom are minor debugging changes that could easily be squashed together (especially the ones that are a few years old). I'm therefore trying to apply rebasing in order to squash together part of my commits. However, I've experience the following issue: When I type e.g. git rebase -i