git-rebase

git rebase --editor=/something/other/than/vim? (for easier squashing)

谁说我不能喝 提交于 2019-12-02 20:02:32
I happily use vim as my default editor for commits, and do not wish to change it. However, when it comes to rebasing, I find myself squashing dozens and dozens of commits which I find much easier with an interactive editor like Textwrangler (substituting "pick" with "squash" in all but the top commit). Is there any way to specify an alternate editor for a one-off rebase command? I know in vim I can do: :%s/pick/squash/ but that has its own minor annoyances. EDIT - as stated in the comments, you can squash all but the top commit very efficiently by going to the 2nd line and executing :,$s/pick

Why are my .csproj files getting messed up after a git rebase?

拟墨画扇 提交于 2019-12-02 19:27:41
In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process: commit my code build and run tests rebase to "get latest" curse the heavens, as the csproj file is screwed up... AGAIN Here's the output on the rebase: D:\GitHub\AwesomeProject>git rebase master First, rewinding head to replay your work on top of it... Applying: added getstatus call Using index info to reconstruct a base tree... M Host/Host.csproj M Host/packages.config M Trees/Trees.csproj M Trees/packages.config M UnitTests

How to do a rebase with git gui?

那年仲夏 提交于 2019-12-02 17:51:43
I know how to do a git rebase from the command line, but how do you do it with the official git-gui ? Add this to the .gitconfig file in your home directory to add rebase commands to the Tools menu: [guitool "Rebase onto..."] cmd = git rebase $REVISION revprompt = yes [guitool "Rebase/Continue"] cmd = git rebase --continue [guitool "Rebase/Skip"] cmd = git rebase --skip [guitool "Rebase/Abort"] cmd = git rebase --abort [guitool "Pull with Rebase"] cmd = git pull --rebase Leif Gruenwoldt In git-gui : Go to Tools -> Add and then enter a custom command i.e. git rebase master . Select Add globally

How to synchronize two branches in the same Git repository?

╄→尐↘猪︶ㄣ 提交于 2019-12-02 17:40:56
Here's a common workflow hurdle I encounter often: master is our "stable" branch $ git status # On branch master nothing to commit (working directory clean) create a module on a branch $ git checkout -b foo $ echo "hello" > world $ git add . $ git commit -m "init commit for foo module" $ git checkout master $ git merge foo do work on master or other branches Over the next couple weeks, more code will be committed to master directly and by other branches. foo branch will go untouched for this time period resume work/make updates on foo branch $ git checkout foo Oh no! foo is massively out of

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

六月ゝ 毕业季﹏ 提交于 2019-12-02 16:12:51
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 HEAD~10 , I get a quite long number of commit lines (much more than 10) in the interactive editor. What

Git - Moving Pushed Commits to a Different Branch

自作多情 提交于 2019-12-02 16:11:39
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 their work within this branch. Additionally, we asked that they push their commits at the end of each day

How to abort a git rebase from inside vim during interactive editing

依然范特西╮ 提交于 2019-12-02 15:45:10
When I do an interactive rebase, e.g. git rebase -i HEAD~3 the rebase interactive editor (vim in my case) opens to let me edit the commits to rebase pick c843ea2 Set Vim column limit to 80 (OS X) pick fc32eac Add Bash alias for `pbcopy` (OS X) .... If I now decide that I want to abort the rebase and quit vim using :q the rebase starts anyway. I'm using git version 1.9.0.msysgit.0 on windows. Sure I can just delete all pick lines, but it might be a lot to do if I rebase a longer history. Is there another way? How can I quit the rebase interactive editor (vim) and abort the rebase? If you exit

Aborted old git rebase and lost commits since the rebase started

半城伤御伤魂 提交于 2019-12-02 15:03:13
Crap! About a week ago, I was rebasing some commits while trying to clean up my repository, and apparently I didn't actually finish it. Today, a week and several commits later, I went to rebase to reorder a few commits from today, and it told me I was already in the middle of a rebase. That should have been a cue to copy my repo just in case. But I did not...instead I ran git rebase --abort which sounded right at the time. Well, that was not right. It aborted the rebase from a week ago and reset master's HEAD to the old one. Dummy! I've got several other branches that are fairly recent, and I

Git rebase merge conflict cannot continue

烂漫一生 提交于 2019-12-02 14:46:25
I'm trying to rebase 'dev' to catch up to 'master' branch. $ git checkout dev $ git rebase master First, rewinding head to replay your work on top of it... Applying: Corrected compilation problems that came from conversion from SVN. Using index info to reconstruct a base tree... M src/com/.... <stdin>:125: trailing whitespace. /** <stdin>:126: trailing whitespace. * <stdin>:127: trailing whitespace. */ <stdin>:128: trailing whitespace. package com.... <stdin>:129: trailing whitespace. warning: squelched 117 whitespace errors warning: 122 lines add whitespace errors. Falling back to patching

can't push to branch after rebase

时间秒杀一切 提交于 2019-12-02 13:50:05
We use git and have a master branch and developer branches. I need to add a new feature and then rebase the commits to master, then push master to CI server. The problem is that if I have conflicts during rebase I cannot push to my remote developer branch (on Github) after the rebase is complete, until I pull my remote branch. This causes duplicate commits. When there are no conflicts, works as expected. question: after rebase and conflict resolution, how do I sync up my local and remote developer branches without creating duplicate commits Setup: // master branch is the main branch git