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 trialJenna Malone
7,173 PointsGetting an error on git checkout new_feature
Hey,
So when I try to switch to the new_feature branch it wont let me. I run a "git checkout new_feature" command and I get the following error....... error: The following untracked working tree files would be overwritten by checkout: file2. Please remove them before you can switch branches. I'm not understanding what is happening or how to fix this. Can someone please help?
1 Answer
Ari Misha
19,323 PointsHiya Jenna Malone! It simply means that before switching to another branch , you might wanna save your changes and commit them coz as soon as you switch to a different branch , you're gonna over-write your files. When i work with git , i make sure i commit my work before switching to master or new branch. And i even merge the changes as soon as i test the branch , so that i can keep track of my changes and my master branch. I hope it helped!
~ Ari
Jenna Malone
7,173 PointsJenna Malone
7,173 PointsHey Ari Misha , I did that though. What I am going to do is start the video over again and start from the beginning and see if that helps, and I will make sure this time that the changes definitely get committed. I will let you know if that works.
Ari Misha
19,323 PointsAri Misha
19,323 PointsJenna Malone Do what makes you feel comfy with your workflow. I mean take a walk and think about it how'd you wanna maintain your code and branches. And make sure you dont complicate stuff, always keep stuff simple. I use built in Versioning Control in IDEs like IntelliJ or PyCharm or Visual Studio or Atom. Every IDE comes with version control extension, and make sure you understand your tools , coz tools enhance your productivity and automate stuff. Good luck! (: