Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Gulp Basics Welcome to Gulp.js Installing Gulp

Sean Flanagan
Sean Flanagan
33,232 Points

Problem with git checkout Stage1Video4

Hi. I have a problem running the above command. Input:

user@user-PC MINGW32 ~/treehouse-gulp-basics (Stage1Video3)
git checkout Stage1Video4

Output:

error: The following untracked working tree files would be overwritten by checkout:
        package.json
Please move or remove them before you can switch branches.
Aborting

How should I switch to Stage1Video4 please?

4 Answers

Fahri Can
Fahri Can
9,921 Points

Did you commit your files in the branch Stage1Video3? In Git you have to commit first your changes, before switching to another branch.

Sean Flanagan
Sean Flanagan
33,232 Points

Hi Fahri. No I didn't run the git commit command before but I've just tried committing Stage1Video4 and I got this error:

error: pathspec 'Stage1Video4' did not match any file(s) known to git.

I've completed the Git Basics and NPM Basics courses.

I don't know what to do.

Fahri Can
Fahri Can
9,921 Points

Hi Sean, just to be sure, did you first entered git add {file name} or git add . to add your files from working area to staging area. After that, did you tried git commit -m "{Your commit message}" ?

Sean Flanagan
Sean Flanagan
33,232 Points

Hi Fahri. I tried git add . but got this message:

warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
Jay McGavren
Jay McGavren
Treehouse Teacher

Git is saying it's going to replace the line ending characters in the file, which should be fine. Those are warnings, not errors. It should be fine to proceed with running git commit, after which you can do your checkout.

Sean Flanagan
Sean Flanagan
33,232 Points

Hi Jay. I rebooted Git, and this was the result of the last command I ran:

$ git checkout Stage1Video4
warning: unable to rmdir treehouse-gulp-basics: Directory not empty
Branch Stage1Video4 set up to track remote branch Stage1Video4 from origin.
Switched to a new branch 'Stage1Video4'

It seems to be working now.

Thanks.

Sean