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 trialMark Chesney
11,747 Pointsunable to git checkout
Hello. This is such a strange circumstance. I've been practicing using git
by committing all my notetaking into a repo.
However, I have this error, in my local cmd terminal:
mark@mchez808 ~/wd/github/treehouse $ git branch
branches+merging
digital-literacy
* master
python
sql-track
mark@mchez808 ~/wd/github/treehouse $ git checkout branches+merging
fatal: Unable to create '/home/mark/wd/github/treehouse/.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
mark@mchez808 ~/wd/github/treehouse $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
renamed: SQL/SQL-reporting-by-example/school-system/Pipfile -> sql/sql-reporting-by-example/school-system/Pipfile
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
deleted by them: SQL/SQL-reporting-by-example/school-system/peewee
(i actually have 8 staged files; for ease I've removed them.)
This looks like the treehouse remote repo for the course SQL-reporting-by-example made some change, and because of it I have an error, but I'm no expert, can anyone help with this unusual but real-life circumstance issue?
Thanks
2 Answers
Eric Butler
33,512 PointsHi Mark,
Follow Git's advice to fix your unmerged paths issue by typing ONE of these:
git rm SQL/SQL-reporting-by-example/school-system/peewee
(if this file doesn't exist or you don't want it in your repo), or git add SQL/SQL-reporting-by-example/school-system/peewee
(if this file exists and you do want it in your repo)
Then to fix the fatal: Unable to create '/home/mark/wd/github/treehouse/.git/index.lock': File exists.
issue, try deleting the existing index.lock
file by typing this line:
rm /home/mark/wd/github/treehouse/.git/index.lock
I'm not totally sure that will fix everything for you, but should get you somewhere.
Mark Chesney
11,747 Pointswoohoo! thank you Eric!
Eric Butler
33,512 PointsAwesome, glad you got it fixed!