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 trialDaniel Hildreth
16,170 PointsGit Checkout Acting Weird
So I have an interesting question here. I'm following along with Tommy, and everything seems to be fine till I get to the Git checkout area or the video. I'm following along in the Treehouse Console, and whenever I go to checkout one of the commits, it seems to erase the other commits. I've had it twice do this to me. I've had it erase my file1, file2, and file3; it has also erased the file2 and file3 when I restarted the Console and re-entered my files and such. Anyone know what's going on?
1 Answer
Amber Cyr
19,699 Pointsit hasn't erased the commits, you just checkout a branch area to a time before you made any changes to them. If you want to checkout all branches with the changes you have made type git checkout master
. If you want to make changes while in checkout mode and commit them permanently, you need to type git checkout -b new_branch_name
Daniel Hildreth
16,170 PointsDaniel Hildreth
16,170 PointsTo try and help clarify, I keep getting a warning message saying something like "warning you are leaving x commits behind..." And then it deletes them when I type in LS command after seeing this warning. So I'm really confused here.