Tag: git branch

Create a new GIT branch based on server without local changes

I think I’m missing some basic idea about GIT branches. Let’s say I’ve cloned a repository on my machine, and started working (on local “master”). Now someone have told me about a bug in production. I want to stop everything I’m doing (modified filed and un-pushed commits), create a feature branch that is based on […]

Git : Make the same edits on two different branches at the same time

I would like to know if it’s possible to work on two branches simultaneously if I want to write code that is supposed to be in those two branches. So that, if I commit my changes, it actually updates both branches. For example : The code in my branch A is this print “I like […]

Difference between git push origin prod AND git push origin prod:refs/heads/prod

When I create a new branch and then want to push it remotely, I can do: git push origin prod OR git push origin prod:refs/heads/prod What is the difference ?

git new branch from commit doesn't checkout the code properly

I have a repo where my master has many commits… i want to create a new fresh branch from the first commit (the original code) so i do as follows: git checkout -b mybranch 4589D6a09505837ec03b where 4589D6a09505837ec03b is the first commit id… everything seems ok and now i’m at mybranch. But I look at the […]

How do I update a remote branch with changes from master

I’ve done a fair bit of research/practices on rebasing and merging our remote branches but I am unable to find a solution that ultimately doesn’t result in duplicate commits or a non-fast forward push of the remote branch. Here’s what I’m trying to do. We have two branches, master (tracking origin/master) and hebe (tracking origin/hebe). […]

How does one copy commits without producing different SHA1s?

As much as I’ve tried to avoid it, I have to maintain three master-equivalient branches with minor changes in each one. I’ve been reading about git and using it for a couple of years, so I’m familiar with the following conventional wisdom: Don’t merge unless it is meaningful. Use rebase instead. If you just need […]

Understanding git branch all

What does the the arrow (->) mean here: * development master production remotes/origin/HEAD -> origin/production remotes/origin/development remotes/origin/master remotes/origin/production I’m just trying to get a real handle on git, so I’m diggin’ deep and finding out that the further I go, the less I know about git, haha.

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

Merge 2 branches in git ignoring branch in between?

I want to merge a branch into another branch selectively & then merge another branch ignoring 1 branch in between. How do I do this with Git? I am using Git Extensions for visual studio.

How do I find if a branch has been merged to any branch (not just a specific one)

I’m trying to clean up some branches in a fairly large project. We essentially have master, a bunch of release branches (of which only the most recent is maintained), and feature/bug fix branches off each release. The process is normally bugfix/feature-branch -> current-release-branch -> master Now I can see there’s quite a few old feature/bugfix […]

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