Tag: git rebase

Merge multiple commits git

I have following commit’s in my branch $ git log –pretty=oneline aa2ea957db6bf5f097b0e2f046c4c3f76758c6d9 Merge branch ‘CentralCache_Stats’ of gi ==> When I pull from master it create new commit don’t why ? 4ece4416421334e8be75893ef1416bb8509d2a44 [744] New API for central cache informa ==> I make changes and did commit –amend then also it create new commit. a49d7ef9f2e0c7adedb8dee96f79ce1d9e2855db Merge branch […]

Rewriting git history, rewrite addition and removal commits

I have a local branch in which I did some development, the commit history is pretty bad so I am going back and rebasing to tidy up and leave it in a sensible state before pushing. Say I have commits A, B, C, D, E. In commit B I have added some useful code that […]

git: automatic line-specific fixup

I recently learned about git commit –fixup which marks your commit as fixup of an earlier commit and automatically arranges them next to each other during an interactive rebase. How can I do that automatically and separately for multiple lines? Take the following example. My git history looks like this: c5069d5 This commit adds method […]

After a cancelled rebase in progress, I cannot update my branch from master branch?

I have a separate branch with many additions on my local and I used to rebase with master branch to keep up with the core development. Last time, since it took too long I cancelled the rebase as it was progressing. After that point, whenever I ask for rebase, git says “Already up-to-date” but I […]

How to merge a git branch to multiple release branches

After a tfs migration (totally different concept of branches) I have to merge fixes to multiple release branches, but the branches are not identical, they are mostly similar, but different products(eg different branding, conn strings etc. ), so i can’t use nvie gitflow one product branching strategy here. https://github.com/MrKekson/stackoverflow_question/network here you can find a greatly […]

Git Squash Not Working

I am trying to use git rebase -i HEAD~10 and this page is shown: As seen on the picture, I am trying to squash 6 commits into one. However, when I save the file, I am not shown another editor for me to give a new commit message for the squashed commits. I also don’t […]

Redo wrong merge in GIT

Long time ago in the git history I can see that someone did a wrong merge of two branches. He had a conflict, so he simply deleted a lot of the conflicted changes. The result is that the main branch doesn’t contain these changes (and we didn’t even suspect it until we checked). Branch feature […]

How to squash all git commits into one?

How do you squash your entire repository down to the first commit? I can rebase to the first commit, but that would leave me with 2 commits. Is there a way to reference the commit before the first one?

How to remove an in-between merge in git?

I want to remove an in-between merge (remove, not squash) and then move the last 2 commits to a new branch. This is my current git log –graph: * 3a5c453 – (2 hours ago) last commit (HEAD, master) * b6c19f1 – (2 hours ago) Merge branch ‘tade’ into HEAD |\ * | be356d0 – (2 […]

How can I undo a git rebase that's already been pulled/merged?

I’m in an odd predicament – we had a developer perform a “git pull –rebase” across branches multiple times, and I’m trying to repair the damage. Our graph originally looked like this: [master] A–B (origin/master) ___\________________________ [branch] \ C–D–E (origin/branch) After the faulty merges, our graph now looks something like this: [master] A–B—————H–I (origin/master) \ […]

Git Baby is a git and github fan, let's start git clone.