GitHub with Gitbox (Mac OS X v10.6 (Snow Leopard))

2.8k Views Asked by At

I'm still learning the dark arts of programming. I'm OK on the programming side, but now I'm struggling to push it to GitHub before I pull it into Engine Yard.

I've made changes, Git sees the changes, but when I commit, I get the following errors:

Command failed: git commit -m Updates

fatal: could not open '.git/COMMIT_EDITMSG': Permission denied

Or, when I try and change branch I get:

error: Your local changes to the following files would be overwritten by checkout:
    app/views/shared/_footer.html.erb
    app/views/plans/index.html.erb
Please, commit your changes or stash them before you can switch branches.
Aborting

I can't commit, and then I'm back to square 1.

I've googled it, but don't really understand the answers.

2

There are 2 best solutions below

2
On BEST ANSWER

The first error you get might be a bug in Gitbox. You should try GitX (download link) instead.

The second one is pretty clear: when your working copy is "dirty" (i.e., you have uncommitted changes), changing branch is impossible. The easiest is to stash them, the stash being a stack of modification where you can push (before changing branch) and pop (after).

1
On

It looks like you don't have read/write permissions to your .git directory in your project. You need to check to make sure that you own the directory and have read write access.