"lose" master when using "git checkout"

github

#1

Everything was working fine. I created my repo in Git and cloned it into my workspace here on c9. Even installed rspec and got that working.

Finished up my work and went to commit:

unoriginalusername:~/workspace/address-bloc (Ruby4Models) $ git status
On branch Ruby4Models
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

            new file:   models/address_book.rb
            new file:   models/entry.rb
            new file:   spec/address_book_spec.rb
            new file:   spec/entry_spec.rb

unoriginalusername:~/workspace/address-bloc (Ruby4Models) $ git commit -m "Create entry and address book models"
    [Ruby4Models a202bd0] Create entry and address book models
     4 files changed, 113 insertions(+)
     create mode 100644 address-bloc/models/address_book.rb
     create mode 100644 address-bloc/models/entry.rb
     create mode 100644 address-bloc/spec/address_book_spec.rb
     create mode 100644 address-bloc/spec/entry_spec.rb
unoriginalusername:~/workspace/address-bloc (Ruby4Models) $ git push origin Ruby4Models
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.69 KiB | 0 bytes/s, done.
Total 9 (delta 0), reused 0 (delta 0)
To github.com:keithmarshak/address_bloc.git
 * [new branch]      Ruby4Models -> Ruby4Models
unoriginalusername:~/workspace/address-bloc (Ruby4Models) $ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
unoriginalusername:~/workspace/address-bloc $ git merge Ruby4Models
fatal: Unable to read current working directory: No such file or directory
unoriginalusername:~/workspace/address-bloc $ git checkout Ruby4Models
fatal: Unable to read current working directory: No such file or directory
unoriginalusername:~/workspace/address-bloc $ git checkout master
fatal: Unable to read current working directory: No such file or directory

So it would seem as though I’ve lost the master branch. Any idea on how I can get back to it?

Thanks.

Edit @ 8am EDT So, I reopen my workspace and see that (A) the four files I had “lost” after falling off master were back and that I was, in fact, back on master branch of my repo. In other words, the promt now read “unoriginalusername:~/workspace (master) $” instead of just “unoriginalusername:~/workspace”.

I was able to merge the checkpoint from 17 hours ago and push to my repo on Git, thereby merging there as well.

Not sure if this was just a temporary hiccup but would love to get some feedback on what the possible cause might be.