Here is the situation. I accidentally committed to master branch which I actually wanted to commit to branch X. Then I merge master to X then git revert the changes on master. But eventually this X will be merged to master but then It won’t merge this reverted change. What is the most proper way… Read More Merging a branch with a reverted change
I am working on a repo from the original base A, to current HEAD (stashed B). In the meanwhile, the remote upstream was updated from A to C. I would like to rebase my local to C and stash B on top of that: Remote: A -> C — —^ | Local: A -> B… Read More How to stash properly on a rebased/reset upstream?
Say I have this commit history: A – B – C (master) \ D – E – F (Feature) I’d like to amend commit B. So, I do: git checkout master git rebase -i <hash of A> After the rebase is done, I see the change using git log. However when I switch to the… Read More Rewriting old commits in the master branch
In a quest to understand Git branches, I’ve come across the following, cited from this page – toward the bottom, Because a branch in Git is actually a simple file that contains the 40 character SHA-1 checksum of the commit it points to, branches are cheap to create and destroy. In a Git repo of… Read More tracking commits in a Git branch