0

I am currently working on a cloud9 project. I have a directory of folders and files in the workspace area of the program already unzipped and ready to go. When I am working in my bash terminal and I just so happen to close it by mistake it won't let me continue where I left off. If I start a new terminal and I enter:

git init
git add . 
git status

It gives me a message of: on branch master nothing to commit, working tree clean.

I am not sure why this is happening if the workspace has files and folders that I want to snapshot then show the status of.

Any ideas on how to fix this issue, as it happens often. Thank you.

123
  • 10,778
  • 2
  • 22
  • 45
Barnes711
  • 21
  • 2
  • "Cause this"? There's no obvious error here. "Nothing to commit, working tree clean" means your changes are already committed, so nothing more needs to be done. It's not related to whether you've opened a new terminal or not. – Charles Duffy Feb 18 '17 at 17:33
  • ...now, it *is* conceivable that you're trying to do a commit in a different environment or context from where you made the changes, but there's really not enough detail in the question to tell either way. – Charles Duffy Feb 18 '17 at 17:36
  • (BTW, if you're trying to work with an already-created repository, `git init` is the Wrong Thing -- it's used to create a *new* repository where you didn't have one at all before). – Charles Duffy Feb 18 '17 at 17:38
  • (Also, removed the bash tag -- this question isn't actually *about* bash in any useful way: you'd have the same behavior with any other shell). – Charles Duffy Feb 18 '17 at 17:40
  • Thank you, how do you work with an already created repository? – Barnes711 Feb 18 '17 at 17:49
  • Once you've `cd`'d into the directory that is the root of the repository, all future git commands will work with it implicitly. – Charles Duffy Feb 18 '17 at 18:06
  • By the way, `git rev-parse --show-toplevel` will show you which directory git things is the root of your current repository. This *should* typically be the root of your workspace -- though of course you'll need to `cd` into that workspace for it to be recognized. If you unintentionally made your home directory a complete git repository (as would happen if you ran `git init` there), you might think about undo'ing that by deleting the `$HOME/.git` directory. – Charles Duffy Feb 18 '17 at 18:09

0 Answers0