Tag: rebase

Git: how can git/linux maintainers maintain so many branches

Personally, if I look at the git or the linux repo with gitk, I am totally overwhelmed by the huge amount of merges/branched. I have absolutely no clue what is going on. I assumed that in general you try to have an as linear history as possible and only a few branches (e.g. master, maint, […]

git equivalent to hg rebase -s source -d destination?

Is there a git equivalent to hg rebase -s source -d newparent? That is, ‘prune’ a branch at source and ‘graft’ it at newparent. Or reparent source on newparent (merging where appropriate). Or how to go for example from this: A – B – C \ D – E \ F To this: A – […]

Rebase a GitHub pull request on top of my newer local commits

Suppose I am locally on the branch master of our blessed repository. Someone has sent in a pull request. How do I apply the commits of that pull request on top of my local branch – as if those commits were rebased on my branch – in a single command? Note: the pull request is […]

How do I preserve the timestamp if I split a commit via git rebase –interactive?

If I use git rebase –interactive and set one line to “edit”, I can say git reset HEAD^ git add -p git commit -m “First part.” git commit -a -m “Second part.” In other words, I split a commit. Unfortunately, this creates current timestamps for the two new commits, which makes the history look funny. […]

Git pull –rebase converting spaces to tabs

This problem is driving me mad. Using Git with Github. I’m working on one particular file using spaces instead of tabs. I always ensure that I change all tab indents to spaces. Diffs confirm that I’ve changed tabs to spaces. I commit and push the code (with other changes) and all is good. Until, I […]

Remove committer information from git commits

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?

git, squashing commits on the fly

I have a local git repo, one remote repo. I made 5 commits to local repo since last pull from remote. Now I need to push to remote. And I need to squash my last 5 commits. I can do it by git rebase -i HEAD~5 But it’s not good. I don’t want to change […]

git pull *after* git rebase?

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 […]

How do I “reopen” a git commit?

(Note, I’m not looking for the answer git rebase -i) In mercurial, I can “reopen” a commit by importing it into my patch queue: hg qimport tip The commit is “open” in the sense that it’s just like before I had committed it, I can revert, do hg diff, hg status, etc. How do I […]

`git branch –list` returns files?

This is strange. I’m trying to make a script that will checkout every local branch and rebase origin/master onto it. So this is my script: for br in `git branch -l`; do git checkout $br git rebase origin/master done Simple. But before I made the script, I wanted to make sure that `git branch -l` […]

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