Tag: branch

git rebase confusion

let’s say if I have 2 branches top and master if I am on feature branch, and run git rebase master does it rebase master or rebase topic branch? doing git rebase –help gave me this Assume the following history exists and the current branch is “topic”: A—B—C topic / D—E—F—G master From this point, […]

Git doesn't sync files until committed, even if checked out in a different branch

Okay, I have git 1.7.11.1 on Windows and I have a local test repository with 2 branches. One is master with index.php and help.php. I then create another branch called slave 🙂 I run from git bash rm help.php and it disappears from the folder, but I don’t stage anything. I switch to checkout master […]

Using Git branches to maintain subdomains of a website

I am not an expert in Git, but I have seen this done before (I just didn’t know the actual implementation behind it). I have my main website at www.foobar.com but I want to have a testing subdomain at beta.foobar.com (or if that’s too complicated, a testing dir at foobar.com/beta) Is there a way to […]

git: how to fix commit in both branches

Being in branch B, I realized I need to fix commit that exists in both branches A and B. Here what I tried to do, but with no result (only fourth commit’s hash changes): #!/bin/bash -eu rm -rf 1 mkdir 1 cd 1 git init echo 1 >1 git add . git commit -am 1 […]

GIT: merge two branches into a new one without dependencies in Gerrit

I have two branches in my local repo: branch_1 and branch_2, each is based on the same commit A and contains several commits (heads are A1 and A2 correspondingly). I pushed both of A1 and A2 to Gerrit master branch and have two separate reviews. Then, I abandoned them. Now I need to create a […]

Moving commit to another branch, and fast forwarding original branch ahead

What I have (assuming left is master, and the right is a feature branch): | * part of feature 2 (HEAD) | | B * | | * bug fix (unrelated to feature) | | | * part of feature 1 |/ A * | So the obvious issue here, is that a bug fix […]

how can I figure out when a branch in git was merged into the trunk

I’m trying to figure out the revision in the trunk when a branch was merged in, but I’m not sure how. Thanks for the help.

Git: How do I selectively copy changes from master to branch?

I created a branch myBranch from the master repo some time ago. Since then, several changes have been pushed to master and now I need to make sure some of these changes, but not all of them, make their way into myBranch. In other words, only some modified files need to be copied from master […]

git rebase local branch on origin/master

I have problems with git: let’s say there was a commit c1 on origin/master 1. I made a branch “local-work”, committed and pushed the branch to origin. c1 <- origin/master c1 <- c2 <- origin/local-work c1 <- c2 <- local-work So far so good. The idea was to work further in this branch and push […]

GIT: How can I do a pull request when I've already commited to my master branch?

My remote repo’s master branch looks like this (each one is a commit): A – B – C – D – E – F – G I would like to get a code review that diffs C and G (C’s changes from B should not be displayed). How do I do this? Do I have […]

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