A repository hosted on an offline Git server for:
- an individual student pulls the coding problems and pushes his codes on his branch.
- the admin to add or change the coding problems for the students.
Assuming that you (admin) wants to host this repository on a server called servername that you have ssh access to, and you want to store the repo under the Desktop/git_server directory.
$ git clone https://github.com/The-Last-Mile-JS/Problems-Submissions.git # clone the repository
$ git clone --bare Problems-Submissions Problems-Submissions.git # create a bare repository
$ mkdir git_server
$ scp -r Problems-Submissions.git username@servername:Desktop/git_server # putting the bare repo to the server$ git clone username@servername:Desktop/git_server/Problems-submissions.git
$ cd Problems-submissions
... # actions of adding/modifying/deleting questions
$ git add <file>
$ git commit -m “[add/modify/delete] Chapter_Name/Question_Name”
$ git push origin master$ git clone username@servername:Desktop/git_server/Problems-submissions.git
$ cd Problems-submissions
$ git checkout -b NAME # creating and switching to personal branch
... # actions of solving a problem
$ git add <file>
$ git commit -m “NAME solves Chapter_Name/Question_Name”
$ git push origin NAME$ git clone username@servername:Desktop/git_server/Problems-submissions.git
$ cd Problems-submissions
$ git fetch origin NAME # fetching personal branch that contains previously submitted solution
$ git checkout NAME # switching to personal branch
$ git merge master # include new problems pushed by instructor
... # actions of solving a problem
$ git add <file>
$ git commit -m “NAME solves Chapter_Name/Question_Name”
$ git push origin NAME