Tag: git branch

How can I move my changes to a new branch after the fact?

I was working on my Rails project which is checked into Git. I read tutorials and they said for every time you start to change something, check out a branch. However, accidentally I made some changes but did not check out a branch. What should I do now? What commands can I run so that […]

How to get 'test' branch into 'master' when 'test' is a branch of 'dev'?

Looking at the network graph for a github project, I see 3 branches of interest; master, test, dev. Looking at the github network graph further, I am led to believe that test is a branch of dev instead of a branch from master. At some point, I will want to put the contents of test […]

My git branch on github should be only 2 ahead but it is also 2 behind

I made a branch from ma master branch called development. The development branch got 2 new commits. Meanwhile the master branch got 1 commit, which was a mistake, then I reverted it and pushed. So far so good. I saw the ahead/behind thingy and I removed the two commits from master (the mistake and the […]

Git ignore and unversioned local files

There are a lot of questions out there covering ignoring things in git, but none seem to work for my particular situation. I have a project that looks like this: proj |-foo/ |–project-file.txt |-bar/ |–project-file2.txt |-temp/ |–machine-specific-file.txt |–machine-specific-file2.txt (EDIT: added for clarity) My .gitignore file: temp/ My project has several branches, all of which have […]

How to remove a branch but keep the orphaned with the same name?

I have a Python project where the documentation is in an orphaned gh-pages branch which I created by following this tutorial. There is a doc/build/html folder in the project where the docs get compiled and where the gh-pages branch is checked out. Now, I accidentally executed the git checkout gh-pages command in the project root, […]

Set remote branch to a commit we don't have locally

Some intern did a force push on master yesterday. After we’ve done scolding, 😉 we looked at the result. Luckily, we had an almost up to date version of the master on one machine, only some pull requests have to be merged again. But one thing is bugging me: We found the old HEAD commit […]

gitk: show branch name on hover

Could you tell how to make gitk tool show the branch name on hover or suggest the tool which is able to do so? gitk shows branches tangle where the branches are nameless, and I have to guess which is master, which stable etc.

Specify '–remote' Heroku app based on git branch

Is it possible to to target an app version in Heroku based on the current Git branch? In the Heroku docs, its specifies how to target a a specific version of the app. # run command on ‘production’ $ heroku run rake db:migrate –remote production To make things easier, you can use your git config […]

git equivalent for –all for all non-remote branches?

The –all parameter is used in various git commands to refer to all branches. Is there an equivalent for all non-remote branches? (Specifically, this came up using git-filter-branch, I’d like to work on all local branches.)

Git sync same branch in two repositories which are cloned from same master

I am trying to implement Git in my company. I decided to implement this model http://nvie.com/posts/a-successful-git-branching-model/ There are three branches in main repo, ie master,develop and feature1. There are two developer named Alice and Bob. Both developers are working on the clone of main repo. Both of them working in feature1 branch. Alice has defined […]

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