views:

290

answers:

1

I am trying out GIT, and using the GIT GUI (from msysgit) with it.

I am trying to make a new branch, but somehow it keeps taking over the master branch. The master branch still appears, but not as the actual master. As a result, I also can't merge my new branch into the master, but it requests me to do the opposite (master into new branch).

Another problem that I have come across (not sure if related), is that GIT GUI is not allowing me to switch between the Master and branch (with check out) without actually merging the two. As far as I understood, this is not a necessary requirement for switching between master and branches.

Thanks...

+2  A: 

I've never used gitgui so I can't help you there but you could try performing the same operations at the command line to make sure things are working at that level. To create a branch from the master and check it out at the same time you would use

git checkout -b <new branch name> [old branch name]

Where [old branch name] would be master. If this is omitted the current branch is used. To switch between branches you would use

git branch <destination branch>

To switch to destination branch. You can list all of the existing branches with

git branch -a

Learning to use git at the command line may be a good idea, you're likely to find more documentation for command line use than for gui use.

[edit]

When you say it makes you merge the two branches what error are you getting? git will not allow you to switch off a branch when you have a dirty working copy. If your working copy has changes you either need to commit them or if you don't want to commit your changes you can stash them using the 'git stash' command (you could also reset your head and throw the changes away completely). Is this what you're seeing when you say that git is making you merge the two branches?

Andrew Myers
Where would I be able to do this? When I open with GIT BASH (the cmd DOS like window) it does not allow me to type anything there.
R P
That is where you should be able to do it. I usually right click on the folder containing my project and click "git bash here". It takes a few seconds to put me in a console where I can type. Maybe there is something wrong with your msysgit install. Something else occurred to me on the way to work, see the edit to my comment.
Andrew Myers
wish there was a way to edit comments :p Is git bash literally not letting you type anything or can you enter commands but they all gives you errors? Just asking because you need to be in your project directory in git bash for any of the commands to work. If you don't run 'git bash here' on your project directory you'll need to 'cd' to it before using commands. May be an obvious question but I thought I would ask to make sure.
Andrew Myers
git bash takes a few seconds to bring up the prompt for me - it will sit there with the intro text for a few moments before I can type anything. You could be experiencing this, R P
Matt Ellen