I recently took CS50 mobile app development with react native course and proceeded for the submission as mentioned but was unable to go to branch cs50/mobile/2018/x/projects/0 as it stated the branch name is invalid also when I visited cs50.me and searched for courses it showed cs50x 2018 and instead of branch as projects/0 it showed Scratch and was given 0 score as in check50 they are showing some weird errors like .sb2 doesn't exist. Any help would be appreciated. (Project 0-todo app)
1 Answer
I'm a big believer in command line, so this might not be the easiest way, but should work reliably.
As I am not taking the same class, I did something to quickly replicate. As you seem to not be using submit50
, I also won't.
You might have done some parts already. I'm starting in my "freestyle" directory where I test out things and have no important files, just in case.
git clone https://github.com/submit50/YOURNAME.git
to clone the shared repo, this will set up remote for you, easier than git init
and fixing the remote later. It will create the repo in a YOURNAME directory.
cd YOURNAME
to change into the repo created locally
git checkout --orphan cs50/2018/x/mario/more
change the slug to your actual project's. This creates a new branch with no ancestor, no history. I chose that one as the various problems are not related, so any ancestor relation would be artificial. Do a non-orphan
checkout if the branch already exists and you want to keep the history.
rm *
in my case there was some file in the current directory I did not want to be part of this particular branch
cp ~/workspace/CS50x_2018/pset1/mario/more/mario.c .
copying whatever I want to submit into the branch. Do however you copy files/directories usually. I use a copy in this case, and do not work directly in the repository, since I fear messing up with git
, it's still new to me. Using a .gitignore
to exclude compile artefacts and sensitive information, working in the repo should actually be a good idea, will have to try that in the future.
git add --all
You could use git add .
in case there are no files to remove. -A
or -all
additionally processes deleted files.
git commit -m "Submitted via command line :)"
with -m
you specify a one-line commit message. And finally
git push origin cs50/2018/x/mario/more
Again, change the slug.
Worked for my mario/more
, the submission shows up on cs50.me in both submissions and the course scores.
edit: I missed the problem with your existing branch on the remote. You cannot have both a branch of my/branch
and my/branch/too
at the same time, so you have to delete the one you don't want. Remote branches can be deleted using
git push origin :my/branch/to/delete
The :
separates the local and remote branch name, so here you push nothing to the existing remote branch.
-
I got this Error:" ! [remote rejected] cs50/mobile/2018/x/projects/0 -> cs50/mobile/2018/x/projects/0 (cannot lock ref 'refs/heads/cs50/mobile/2018/x/projects/0': 'refs/heads/cs50/mobile/2018/x/projects' exists; cannot create 'refs/heads/cs50/mobile/2018/x/projects/0') error: failed to push some refs to 'github.com/submit50/User.git" Commented Oct 11, 2018 at 19:07
-
Use
git push origin :cs50/mobile/2018/x/projects
to delete the branch– BlauelfCommented Oct 11, 2018 at 20:03 -
-
Can you help me with the evaluation part, how can I know that my code worked fine? Commented Oct 12, 2018 at 14:54
-
I don't think this kind of project has an automated evaluation process, as it is too complex with too little specification (an example with a lot more specification would be CS50x pset7 finance). If you can give it another person and they cannot find a way to break it within a minute or so, you're probably fine.– BlauelfCommented Oct 12, 2018 at 15:15
submit50
, or creating the git branch yourself?git checkout -b cs50/mobile/2018/x/projects/0
orgit branch cs50/mobile/2018/x/projects/0
(and maybe additional parameters)?