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

JavaScript Express Basics (2015) Using Templates with Express The “response.render” Method

Every time that I CD into the express-basics folder and run the git checkout responseRenderMethod I get an error.

Do I not have the folder setup correctly on github?

error: The following untracked working tree files would be overwritten by checkout: .gitignore package.json src/app.js src/mock/posts.json src/templates/index.jade src/templates/post.jade Please move or remove them before you can switch branches. Aborting

2 Answers

Seth Kroger
Seth Kroger
56,413 Points

Git is telling you there are changes you've made that you haven't added and committed yet. It you checkout a new branch now, those changes will be lost forever and git assumes that's something you don't want. After all, git's entire purpose is to track those changes and keep them around if you need them. You'll either need to add and commit the files (git add -A followed by git commit -m "Commit Message Here"), or use the --force flag when you checkout the branch if you just want to discard your edits.

Thanks you.

I wasn't sure if i was suppose to be committing the changes to the git repository of the project