0

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)

  • Are you using submit50, or creating the git branch yourself? – Blauelf Oct 11 '18 at 13:00
  • I am creating the git branch, actually I did as instructed went to git/username page of sub50 and in that tried to paste the path provided "cs50/mobile/2018/x/projects/0" in branch. I don't know much about git hub – LiquidNitrogen Oct 11 '18 at 13:12
  • That's not a path, but the branch name. – Blauelf Oct 11 '18 at 13:28
  • yeah means we have to use this name in branch, but when I enter this name I get invalid branch name in response – LiquidNitrogen Oct 11 '18 at 13:58
  • You mean you created the branch with like git checkout -b cs50/mobile/2018/x/projects/0 or git branch cs50/mobile/2018/x/projects/0 (and maybe additional parameters)? – Blauelf Oct 11 '18 at 15:09
4

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.

| improve this answer | |
  • 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" – LiquidNitrogen Oct 11 '18 at 19:07
  • Use git push origin :cs50/mobile/2018/x/projects to delete the branch – Blauelf Oct 11 '18 at 20:03
  • Thank you so much, It worked perfectly. – LiquidNitrogen Oct 12 '18 at 12:22
  • Can you help me with the evaluation part, how can I know that my code worked fine? – LiquidNitrogen Oct 12 '18 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. – Blauelf Oct 12 '18 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .