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

Development Tools Introduction to Git First Commits Initializing a Repository

Stefan Cutajar
Stefan Cutajar
7,747 Points

how to access an existing git repo

Hi , I was experimenting a little with git however I'm still very beginner to this and I kind of lost control of what is happening so I decided its best to delete the workspace and start all over again and at the same time I will be practicing what I've learned so far.However that didn't worked as expected. I started by changing directory to medals no problems so far. Now when I type git init this is what I get back: Reinitialize existing GIt repository in /home/treehouse/workspace/medals.git/ I tried then to add bronze .html but then I typed git status and got back nothing to commit, working directory is clean. Can someone help me to get back on track so I can continue to follow along with the lectures please? Sorry if I didn't explain my self good enough but I am totally a beginner in this. Any help will be very appreciated thanks in advance.

2 Answers

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

I started by changing directory to medals no problems so far. Now when I type git init this is what I get back: Reinitialize existing GIt repository in /home/treehouse/workspace/medals.git/

That means that a .git directory already existed at the time you ran git init. It looks like you started your workspace based on the template attached to the "Viewing Changes to a File" video, in which case the workspace would have already had a .git directory.

I tried then to add bronze .html but then I typed git status and got back nothing to commit, working directory is clean.

When git says the working directory is "clean", it means there are no modified files. That is, the files have the same content that they did at the last time git commit was run. You will need to use the editor to make changes to one or more files (either the same changes that are shown in the video, or changes of your own) before you can run git add on them.

It would have been better if you had given us a screenshot.

This is what i would do

1-----git add bronze.html

2-----git status (here it should files i have added and if there are any left). Git even shows you a message of what you can do on this stage.

3-- you then commit you changes with git commit -m and your commit message

4--If you are satisfied you then send your files to your remote repository using git push

Stefan Cutajar
Stefan Cutajar
7,747 Points

Thanks for your reply I tried it but no luck :/ please check out my workspace snapshot in this link -> https://w.trhou.se/fvscpbt83c maybe you can understand better what is going on.