Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Terminal Issues - Please Help!

Hi,

I'm on the video "Adding Styling" in Stage 4 of "Build A Simple Ruby App". I tried to commit the changes to Github, but I pressed something or other by mistake and now I can't get it to work. To make matters worse it's also added .DS_Store to the commit and I don't know what to do! Please advise. Oh and in case you're wondering, I'm calling my app Mango instead of Treebook. The message from the terminal is:

Adams-MacBook-Air:Mango adamflanagan$ git add .
Adams-MacBook-Air:Mango adamflanagan$ git commit 

E325: ATTENTION
Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"
          owned by: adamflanagan   dated: Sun Dec 22 19:25:48 2013
         file name: ~adamflanagan/Projects/Mango/.git/COMMIT_EDITMSG
          modified: YES
         user name: adamflanagan   host name: Adams-MacBook-Air.local
        process ID: 3916
While opening file ".git/COMMIT_EDITMSG"
             dated: Sun Dec 22 19:33:31 2013
      NEWER than swap file!

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r .git/COMMIT_EDITMSG"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".git/.COMMIT_EDITMSG.swp"
    to avoid this message.

Swap file ".git/.COMMIT_EDITMSG.swp" already exists!
-- More --

3 Answers

Stone Preston
Stone Preston
42,016 Points

Add ds_store to your git ignore file.

It's already there but its not working. But the most pressing issue is not being able to commit the changes?

James Barnett
James Barnett
39,199 Points

It looks like you did a git commit without -m, which opens up your default text editor for you to enter your commit message. That error means you currently have an open commit and git it expecting you to finish your commit message.

You've got 2 options:

  • Find the session and finish it (preferable).
  • Delete the .swp file (if you're sure the other git session has gone away).

source: http://stackoverflow.com/a/13361874/1756132