Tell us what’s happening:
This is pertaining to the question in the course as shown below:
You’re getting the hang of it The process is to create a branch, make the changes you want, commit them, and then merge the changes into branch you started on. Pretty simple, lets keep going. Create and checkout a new branch named feat/add-column-references
Even though I have typed the answer in the terminal exactly as expected, I get the message: “You should use git checkout to switch to the correct branch”
Your code so far
codeally@2c9bd2638921:~/project$ git checkout -b feat/add-column/references
Switched to a new branch ‘feat/add-column/references’
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Learn Git by Building an SQL Reference Object - Build an SQL Reference Object
I wonder how that happened. I rewrote the command to adhere to the correct name and this is what I got on the terminal:
codeally@da766edd6bd4:~/project$ git checkout -b feat/add-column-references
Switched to a new branch ‘feat/add-column-references’
codeally@da766edd6bd4:~/project$ git branch
I did a reset. It cleared the last step. Then I reran the command. same result/error message. “You should use “git checkout” to switch to the correct branch”
code as below:
codeally@ed913cfb114f:~/project$ git branch
* feat/add-column-references
feat/test
master
codeally@ed913cfb114f:~/project$ git branch
feat/test
master
codeally@ed913cfb114f:~/project$ git checkout -b feat/add-column-references
Switched to a new branch 'feat/add-column-references'
codeally@ed913cfb114f:~/project$
Tried a whole bunch of commands. Here is the latest:
codeally@ed913cfb114f:~/project$ git checkout master
error: Your local changes to the following files would be overwritten by checkout:
.freeCodeCamp/test/.cwd
.freeCodeCamp/test/.next_command
Please commit your changes or stash them before you switch branches.
Aborting
codeally@ed913cfb114f:~/project$ git reset --hard
HEAD is now at d1508036 commiting to master
codeally@ed913cfb114f:~/project$ git branch
* feat/add-column-references
master
codeally@ed913cfb114f:~/project$ git checkout master -f
warning: unable to rmdir 'learn-git-by-building-an-sql-reference-object': Directory not empty
warning: unable to rmdir 'sql_reference': Directory not empty
Switched to branch 'master'
codeally@ed913cfb114f:~/project$ git branch
feat/add-column-references
* master
codeally@ed913cfb114f:~/project$ git branch -d feat/add-column-references
error: The branch 'feat/add-column-references' is not fully merged.
If you are sure you want to delete it, run 'git branch -D feat/add-column-references'.
codeally@ed913cfb114f:~/project$ git branch -D feat/add-column-references
Deleted branch feat/add-column-references (was d1508036).
codeally@ed913cfb114f:~/project$ git branch
* master
codeally@ed913cfb114f:~/project$ git checkout -b feat/add-column-references
Switched to a new branch 'feat/add-column-references'
codeally@ed913cfb114f:~/project$ git branch * feat/add-column-references
master
codeally@ed913cfb114f:~/project$ git branch
* feat/add-column-references
master
codeally@ed913cfb114f:~/project$
I am sorry it took this long to respond, but I’m very easily distracted…
I think I know what is wrong finally.
your last efforts were all taking place in the wrong directory.
So please drop all the branches except for main and then go to the
sql_references directory (not the ~/project)
and try there the same git checkout -b feat/add-column-references
Thank you for your suggestion. I finally got back to it and tried it. Unfortunately I still get the test runner failed.
codeally@ce2040d0b442:~/project$ cd sql_reference
codeally@ce2040d0b442:~/project/sql_reference$ git branch
* main
codeally@ce2040d0b442:~/project/sql_reference$ git checkout -b feat/add-column-references
Switched to a new branch 'feat/add-column-references'
codeally@ce2040d0b442:~/project/sql_reference$ git branch * feat/add-column-references
main
codeally@ce2040d0b442:~/project/sql_reference$ git branch feat/add-column-references -d
error: Cannot delete branch 'feat/add-column-references' checked out at '/home/codeally/project/sql_reference'
codeally@ce2040d0b442:~/project/sql_reference$ git branch feat/add-column-references -f
fatal: Cannot force update the current branch.
codeally@ce2040d0b442:~/project/sql_reference$ git checkout main Switched to branch 'main'
codeally@ce2040d0b442:~/project/sql_reference$ git branch feat/add-column-references -f
codeally@ce2040d0b442:~/project/sql_reference$ git branch feat/add-column-references
* main
codeally@ce2040d0b442:~/project/sql_reference$ git branch feat/add-column-references -d
Deleted branch feat/add-column-references (was 0ae0bd4).
codeally@ce2040d0b442:~/project/sql_reference$ git branch * main
codeally@ce2040d0b442:~/project/sql_reference$ cd..
bash: cd..: command not found
codeally@ce2040d0b442:~/project/sql_reference$ cd..
bash: cd..: command not found
codeally@ce2040d0b442:~/project/sql_reference$ cd ..
codeally@ce2040d0b442:~/project$ git branch
* feat/add-column-references
master
codeally@ce2040d0b442:~/project$ git checkout main
error: Your local changes to the following files would be overwritten by checkout:
.freeCodeCamp/test/.cwd
.freeCodeCamp/test/.next_command
Please commit your changes or stash them before you switch branches.
Aborting
codeally@ce2040d0b442:~/project$ git checkout master
M .freeCodeCamp/test/.cwd
M .freeCodeCamp/test/.next_command
Switched to branch 'master'
codeally@ce2040d0b442:~/project$ git branch
feat/add-column-references
* master
codeally@ce2040d0b442:~/project$ git branch feat/add-column-references -d
Deleted branch feat/add-column-references (was 8c29786f).
codeally@ce2040d0b442:~/project$ git branch
* master
codeally@ce2040d0b442:~/project$ cd sql_reference codeally@ce2040d0b442:~/project/sql_reference$ git branch
* main
codeally@ce2040d0b442:~/project/sql_reference$ git checkout -b feat/add-column-references
Switched to a new branch 'feat/add-column-references'
codeally@ce2040d0b442:~/project/sql_reference$ git branch * feat/add-column-references
main
codeally@ce2040d0b442:~/project/sql_reference$
unfortunately i think you will have to login to codeally and in the dashboard delete this container and restart from scratch. I haven’t seen anyone hit this specific ‘runner failed’ error yet who was able to get around it any other way.