Tag: git-rebase

How to properly push one git repository over another on codebasehq?

I need to know the proper way to move git history from one repository to another on codebasehq.com. Situation: there is a repo on codebasehq.com which I call “old” on path like mycompany.codebasehq.com/projects/OLDNAME/repositories/PROJECTNAME after some development in old repo the team realized that this repo should actually be in different location on codebasehq.com and did […]

Can git figure out that the branch to be merged has obsolete changes?

I am new in git and I am find it hard to wrap my head around the fact that everything is around snapshots/commits and not individual files. So assume that I have a tree in my repository as follows. C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 Now I branch out from here: B1 (HEAD, […]

How to split every commit by file?

I know how to manually split a commit using git rebase -i, but how can I automatically split every commit in a branch by file? For instance, commit A modified 3 files, f1, f2 and f3. After the split, there are 3 commits A-f1, A-f2 and A-f3. I want to do this to make a […]

git rebase implementation details

I am trying to figure out the working mechanism of git-rebase. Documentation provides information about what git-rebase does, but doesn’t comment on how it does? I have looked into the source code, worked out some test cases and so far understand following: 1. Git maintains the state of rebase in .git/rebase-apply (with files like patch, […]

How to clean up unused side-branches in your commit trees?

How would you clean up unused side-branches in your commit trees (not real git branches)? Example (tree, fake-commit-hash, commit message, optional [pointers]): * 0001 last commit [master] [origin/master] [HEAD] | * 0002 old, unused merge |/| * | 0003 some remote commits * | 0004 another commit from remote | * 0005 old, unused commits […]

Local Git branch has diverged from origin following an interactive rebase

I have a local branch (CRM-ayrshireminis) that has a couple of commits on it that I have pushed to the origin (origin/CRM-ayrshireminis). This branch was created from the develop branch about one week ago, on which there have been one weeks worth of work from other collaborators. What I want to do is rebase the […]

I can't git rebase –interactive anymore

I’m having a serious problem trying to do git rebase –interactive on my repo. I get the cryptic error fatal: ref HEAD is not a symbolic ref, and my rebase ceases to function. I must git rebase –abort to get back to a good state. Here are the output(s) I receive: https://gist.github.com/d38f1e2d2ec9bc480b6f What I’ve been […]

How do I reduce the size of a bloated Git repo by non-interactively squashing all commits except for the most recent ones?

My Git repo has hundreds of gigabytes of data, so I’m trying to remove old, outdated commits, because they’re making everything larger and slower. I need a solution that’s fast; the faster, the better. How do I squash all commits except for the most recent ones, and do so without having to manually squash each […]

How to Reorder Commits (rebase) with TortoiseGit

I want to push several single commits to our main git repository. After doing some reading though it sounds like I have to reorder the commits in order to do this, because git will only push all commits up to a specified commit. First, I don’t really understand why this isn’t just built in to […]

Rebasing to change parent of a merge commit

Suppose I’ve got the following history, where the top line is the master branch, the lower one is a feature branch that’s merged with master at one point, and D just reverts C (which means that the working directory is the same in B and D). A—B—C—D master \ \ E—F—G feature I want to […]

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