Closed Marzdor closed 5 years ago
I think I did it correctly first time doing this lol.
@Marzdor, sorry that you've been having trouble with this. Hopefully we'll get this sorted out.
You can follow @Nirajn2311's instructions above to reset the changes made to package-lock.json. Alternatively, you can run the following commands:
First, make sure you're on the right branch with git checkout fix/debugging-challenge-typo
. Revert the changes to the package-lock.json file with git checkout upstream/dev -- package-lock.json
. This will get it in line with the package-lock.json file from the freeCodeCamp/Curriculum dev branch. Then, run git commit --amend
and exit out of the editor to use the same commit message. Finally, run git push -f origin fix/debugging-challenge-typo
to push the changes to the package-lock.json file to your branch. We should then see the changes reflected here and will be able to merge your fix.
Let us know if we can help with anything else!
@scissorsneedfoodtoo I followed @Nirajn2311 instructions and all the checks show passing is there something else that I am missing?
@Marzdor sry I forgot to tell one more thing, you don’t have to include package-lock.json when you commit.
@Nirajn2311 I figured that but I am not sure how to go about removing it from the commit.
@Marzdor, could you follow the steps from my comment above? I tested them with your PR on my machine and it should solve the problem with the package-lock.json file.
git checkout upstream/dev -- package-lock.json
says fatal: invalid reference: upstream/dev
I don't believe you set the upstream yet. In that case, please run git remote add upstream https://github.com/freeCodeCamp/curriculum.git
and try the commands listed above again.
I have it set and i still get that error
$ git remote -v
origin https://github.com/Marzdor/curriculum.git (fetch) origin https://github.com/Marzdor/curriculum.git (push) upsteam https://github.com/freeCodeCamp/curriculum.git (fetch) upsteam https://github.com/freeCodeCamp/curriculum.git (push)
I think I see the problem. Seems like your remote is spelled upsteam rather than upstream. Let's rename that first before you go through the steps again:
git remote rename upsteam upstream
After that you should be able to go through the steps listed above.
I renamed it to be upstream and it still gives me the invalid reference
That's strange, I'm not sure why you're still getting the error. Could you run git remote -v
again and post the output?
I am not sure if if that space between upstream and the url is messing it up but I tried removing it and it always has the space
$ git remote -v
origin https://github.com/Marzdor/curriculum.git (fetch)
origin https://github.com/Marzdor/curriculum.git (push)
upstream https://github.com/freeCodeCamp/curriculum.git (fetch)
upstream https://github.com/freeCodeCamp/curriculum.git (push)
@Marzdor, that seems fine. I get the same output when I run that command on my machine. Does git checkout upstream/dev -- package-lock.json
still throw an error? If so we can figure out some other way to get the package-lock file sorted.
Yes, it still gives me the invalid reference error.
Sorry that you're still getting the error. We could try looking into the git log and try to figure out what point to roll back to, but I fear we might have polluted the log by messing with the remote name.
The easiest thing to do now would probably just be to go to the package-lock file in the dev branch, copy it, and paste it over the one in your branch. Not ideal, but it's something I've done in the past when I accidentally committed it.
After I copy it to my branch do I have to re commit or anything?
Yes, you'll have to add the file, run git commit --amend
to use the same commit message, and force push it to your branch with git push -f origin fix/debugging-challenge-typo
. After that we should be good.
Okay, lets see if that worked.
@Marzdor you have included package-lock.json again
when I do git commit --amend it gives me this.
docs(tools): fixed a typo in the challenge "you" => "your"
ISSUES CLOSED: #17947
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
Date: Mon Sep 3 16:29:00 2018 -0700
On branch fix/debugging-challenge-typo
Changes to be committed:
modified: challenges/02-javascript-algorithms-and-data-structures/debugging.json
modified: package-lock.json
Changes not staged for commit:
modified: package-lock.json
Looks like you're on the right track, but haven't added the package-lock.json file. Add it by running git add package-lock.json
, then run git commit --amend
again to use the same commit message, and finally git push -f origin fix/debugging-challenge-typo
.
Oh, yeah, I think it worked.
@Marzdor it has worked and everything LGTM.
:sparkles: :sparkles: :sparkles: Awesome! Congratulations on your first contribution to freeCodeCamp! :sparkles: :sparkles: :sparkles:
Thank you for submitting a PR for this issue, @Marzdor. Sorry about all the trouble with git. Glad you were able to work everything out and we could get your change merged. We're all really looking forward to your next contribution! Also, thank you @Nirajn2311 for your support with this PR!
ISSUES CLOSED: #17947
Description
Pre-Submission Checklist
dev
branch.fix/
,feature/
, ortranslate/
(e.g.fix/challenge-tests
)npm test
.npm run commit
to generate a conventional commit message. Learn more here: https://conventionalcommits.org/#why-use-conventional-commitsChecklist:
Closes #17947