0

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
RedCuber
  • 97
  • 1
  • 3
  • 5

2 Answers2

2

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ipd
  • 5,674
  • 3
  • 34
  • 49
1

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).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
CharlesB
  • 86,532
  • 28
  • 194
  • 218