rebase

Git squash all commits in branch without conflicting

感情迁移 提交于 2019-12-02 15:51:42
A common development workflow for us is to checkout branch b , commit a bunch to it, then squash all those commits into one (still on b ). However, during the rebase -i process to squash all the commits, there are frequently conflicts at multiple steps. I essentially want to alter the branch into one commit that represents the state of the repository at the time of the final commit on b I've done some searching but I haven't found exactly what I'm looking for. I don't want to merge --squash because we would like to test the squashed feature branch before merging. Rasmus Østergaard Kjær Voss If

Git interactive rebase no commits to pick

痞子三分冷 提交于 2019-12-02 14:47:06
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, if you remove everything, the rebase will be aborted. # I would like to pick some commits not all as

Git: how to maintain permanent parallel branches

放肆的年华 提交于 2019-12-02 14:42:25
We have project (PHP application), but instalation for each client vary, sometimes very little, sometimes more. Still, big part of source code is common. We manage specific installations as parallel branches to master branch and we need to transfer changes from master to other branches. Same situation was solved in Git: how maintain (mostly) parallel branches with only a few difference? The most voted solution was to transfer changes between braches this way: git pull git checkout local git rebase master As mentioned in the solution it creates non-fast-forward pushes after rebasing which I

git pull *after* git rebase?

删除回忆录丶 提交于 2019-12-02 14:10:21
I have a feature branch, and a master branch. Master branch has evolved and I mean to have those updates to diverging as little as possible from master branch. So I git pull in both branches, git checkout feature/branch and finally git rebase master . Now here I either expect everything to work smoothly or conflicts showing up that I need to resolve before continuing rebase until all master commits are re-applied successfully on feature branch. Now what really happened in my case is something I do not understand: $>git rebase master First, rewinding head to replay your work on top of it...

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

SVN2Git object reference error

偶尔善良 提交于 2019-12-02 09:17:15
My problem: Migration by an Ubunut VM in Windows; Windows had a blue screen of death; Windows restarted; the migration was damaged! ~/folder$ svn2git --rebase error: refs/remotes/svn/some_branch does not point to a valid object! fatal: git cat-file 81974ef70e6b9dba85295bf7341dd6808c03250d: bad file cat-file commit 81974ef70e6b9dba85295bf7341dd6808c03250d: command returned error: 128 command failed: git svn fetch I already tried to fix my problem like mentioned in these answers: https://stackoverflow.com/a/802297/575643 https://stackoverflow.com/a/12371337/575643 Unfortunately none helped me so

Can I safely rebase one branch into other and then to master?

送分小仙女□ 提交于 2019-12-02 09:08:06
I have to development branches and I found branch B depending on code from branch A . I want to rebase A into B so I can keep on developing B . Soon A will be merged to master (before B ), but not now. Then, when I merge B , will it break the reference from having A rebased on it? Can I just then rebase B on master and all will be fine or do I need to do any special step? Note that git (and pretty much all other version control systems) calls this rebasing on to, not in to. You may indeed do this kind of rebase. However, it's important to know that when you rebase some commit(s), git actually

'Ignore' binary files in git rebase 'theirs'

若如初见. 提交于 2019-12-01 21:56:48
I want to go from this A - B - C - D - E - F - G where Branch1 is pointing at E and Branch2 is pointing at G to this: Branch1: A - B - C - D - E \ Branch2: F - G And I want Branch2 to always 'win', I've got as far as this: git rebase -s recursive -X theirs --onto C Branch1 Branch2 That works fine - except that rebase chokes on binary files - saying it can't merge them. How do I go about telling git that I don't want to merge them, I just want to take 'theirs' each time? VonC How do I go about telling git that I don't want to merge them, I just want to take 'theirs' each time? That would be

Remove committer information from git commits

二次信任 提交于 2019-12-01 15:31:33
问题 I have rebased a branch and now all its commits have committer section which I would like to remove completely (not just changing it's fields). Is it possible without losing the original author info? 回答1: Thanks to @sergej and GitHub , I got committer info removed with git filter-branch --env-filter ' if [ "$GIT_COMMITTER_EMAIL" != "$GIT_AUTHOR_EMAIL" ]; then export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE

Git: how to use rebase with theirs strategy

泄露秘密 提交于 2019-12-01 11:33:31
Basically, I just want to (re)set the parent (let's say to commit A ) of a specific commit (commit B ) which is the root commit of some branch x . It is suggested here in one of the answers that I can do that via grafts. I will try that later, maybe it's the better way. However, before reading this, I thought that this should be possible via rebase . But because the parent commit A differs a bit from B and I just want to stay the whole branch x the way it is, just with setting a parent to its root commit B , I thought I might use the theirs strategy -- which doesn't seem to exist. I have