Tag: rebase

git workflow, and merging changes from master into branches

Having struggled with SVN I was told I should check out GIT, as the branches would be ideal for the workflow I am trying to achieve. I have been muddling along and think I have the basics of GIT sorted now. We basically have a central framework that some of our clients use, and I […]

Switching Git workflow from merge to rebase: how to clean up a merge commit history?

I’m trying to have a good Git workflow for contributing to an open source project (Endless Sky), but learning as I started out I’ve not ended up with a clean history. My workflow now is: upstream/master is here. My fork is here. I started using GitHub Desktop, but am beginning to switch to the command […]

git – reorder commit on branch as early as possible without a conflict

How would I go about moving a commit up a branch to be as early as possible without any conflicts (without much manual work, eg rebase -i)? Eg A-B-C-D-X should become A-B-X-C-D if swapping X with C and D has no conflicts but swapping X with B would result in a conflict. Thanks.

Reorder git commit history by date

I have merged 3 different git repos into one now my history looks something like this: A1-A2-A3-B1-B2-B3-C1-C2-C3 Now i want to re-order all these commits by date. So finally it may be something like C1-A1-A2-B1-C2-… you get the idea I am ok if I loose all the original SHA commit ids. And of course I […]

How to rebase commits from another repository with a different history?

We have two Git repositories. Repo 1. Commits: A, B, C. This repository was created from SVN history. Repo 2. Commits: D, E, F. This repository was created without SVN history, just by using the working copy (as of commit C) which became the commit D. In another words, the file trees of the commits […]

How do I interactively rebase a git topic branch in isolation without counting commits?

If I have branches master and topic like so: A — B — C — D (master) \ W — X — Y — Z (topic) And I need to manipulate the commits on ‘topic’ with various fixups, squashes, amends, etc., I would typically checkout ‘topic’ and run git rebase -i. Lets say I do […]

„Floating“ commit in git

In a project of ours we have, as usual, a master branch. Based on that is the deployment branch, where the settings are modified. Also based on that is a mirror branch that runs the mirror of the deployment. The master branch ought not contain any config changing patches. Small features and fixes are developed […]

Does git merge –squash cause headaches with cross branch merges

I’m working in a team which is growing and making use of git. We are generally working in our own branches. I pulled some changes from another workers repository. His changes eventually were added to and merged into a master branch with a squash commit. When I tried to fetch from master and merge I […]

How do I make a copy of a branch for testing rebase?

I’ve done this before by creating a clone and doing the rebase in the clone, but I suspect I could do it safely on a separate branch. I have a feature branch feat-x with about 25 commits on it. I’d like to (safely) squash several of these together. (I say “safely” because the first couple […]

Is git pull –rebase safe if you are in a centralized model and never push force?

There’s a lot of git questions on the safety of rebase and there seems to be consensus that as long as you remember that rewriting public history is rude, you should be safe, i.e. if none of the commits you haven’t pushed to the repo from which you are pulling, you are safe. However there […]

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