Tag: git rebase

git cherry-pick a range of commits to prevent history breakage

Short description of problem After a new developers group joined our project they initialized a new repo and copied (not merged!) snapshot of master into newly created repo. So in their branch old files lost history of commits which exist in master. After that they started typical git workflow with comitting, branching, merging updates from […]

git rebase master based on timestamp

How do I rebase a repo with duplicate commits based on timestamp ? Some background: We have a dirty repo because of transferring from one git remote to another git remote and adjusting username on the new git remote endpoint. That results in double commits from “another” user, which is actually the same. The single […]

Remove “obsolte” merge commits

This is probably a relatively easy question to answer but I don’t seem to be able to come up with the solution myself (or find it on the net). So I’m counting on you!! 🙂 Short: In a history where I’ve merged a feature branch into master several times over the course of time, I’d […]

Git: rebase merge commit “–preserve-merges”

I found that git offers the option “–preserve-merges” for rebasing merge commits. My Problem is now: When I have to do a difficult merge with lots of merge conflicts and then do “git rebase –preserve-merges”, what happens is the git actually wants me to do the whole merge again. It forgets my conflict resolutions from […]

Git removed commits on remote reappear

We have different branches for our different versions of a project. Somehow a section of commits from a dev branch was merged into a production branch. We assumed it was a git stash apply error on the new branch and proceeded to remove the commits (there were only 5-6) with git rebase -i {commit hash}^ […]

Should I worry about repeating commit logs following rebase upstream/master?

I’m a git newbie, and can’t find the answer to my issue elsewhere. Apologies if it’s a rather basic question. So: I’ve forked from a project, and then cloned my fork. I’ve set my remotes up so that I have the upstream (originalproject/sitename.git) and an origin (myfork/sitename.git). I’ve created a branch from my local master […]

git rebase – is squashing initial commits generally a bad idea?

Am I right in thinking it’s not a good idea to squash initial commits in most repos? I’ve seen lots of answers telling you how to squash the last commits but I assume, on a shared repo, it’s not wise to squash initial commits as you’re basically rewriting history.

Changed AuthorDate and CommitDate after git rebase

As far as i know GIT is tracking two dates for each commit. the AuthorDate stores the original time of the commit the CommitDate originally is set to the same date, but gets changed e.g. if a commit from one branch is pulled into another branch when doing a git rebase I am having a […]

Why am I having conflicts during rebase when I am the only developer on my Github project?

I am new to Git and tried Github to learn the new source control system and I am wondering why am I having conflicts after a rebase or even a merge when I am the only one contributing to it. Since I am the only dev, shouldn’t my version of the source always be in […]

How can I make previous commits look like they are being worked on live?

Let’s assume that a series of commits were made throughout the day: [1:00pm] $ commit -am “commit 1” [2:00pm] $ commit -am “commit 2” [3:00pm] $ commit -am “commit 3” Instead of pushing all of these commits at once, I would like to replay the commits, while pushing each one at delayed times. How can […]

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