Please install Git on your local machine https://git-scm.com/download
Verify it's done:
- In console type
git --version - If you see smth like
git version 2.29.2.windows.2you're done
We're highly recommend to configure SSH key for your machine (Windows/MacOS/Linux/etc) and put it into your Github account.
Follow this instruction to complete that step: https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-configure-GitLab-SSH-keys-for-secure-Git-connections
you can get your public key by run in terminal cat ~/.ssh/id_rsa.pub
- Navigate to https://github.com/School-of-Digital-Competencies/js-ts-tasks
- Click on
Forkbutton in the top right corner - Select your personal account in the
Ownderdropdown - Don't change the
Repository name - Uncheck button
Copy the main branch only - Click on
Create forkbutton - Navigate to your forked repository
- Navigate to your forker repository and click on green button
Clone - In dropdown find section Clone with SSH and copy that url git@github:...git
- In console on your machine navigate to any folder you like and paste copied url after git clone:
git clone [email protected] - Type in yes if console asks you about fingerprint
- After cloning is done, in console type in
cd js-ts-tasksand click Enter - Now you should be in a folder
js-ts-tasks - In console type in
git config user.name "Name Surname"where Name is your Name (same as on Github profile) and Surname is your Surname (same as on Github profile). Your name should be written in English. Don't remove " " symbols - In console type in
git config user.email [email protected]where[email protected]is your address you used to register on Github (the same as on Github profile) - In console type in
git config user.nameand click Enter. You should see your name - In console type in
git config user.emailand click Enter. You should see your email address
We are using different branches for your hometasks
main - used for general repository instructions
Each branch starting with hometasks-... contains a set of tasks dedicated to the lecture module.
hometasks-sections-hero
hometasks-sections-forms
...
To solve each hometask you must checkout to the related branch into your local cloned repository
Please add remote branch linking into your local git
To do this, please in console run commands
git remote rm upstream
git remote add upstream https://github.com/school-of-digital-competencies/js-ts-tasks
In Source Control menu click on three dots -> Remote -> Add remote -> Paste https://github.com/school-of-digital-competencies/js-ts-tasks -> Enter upstream
NOTE You might need to remove previously created upstream. In Source Control menu click on three dots -> Remote -> Remove remote -> upstream.
When the linking is created (see instructions above), run command git fetch upstream to get a new branch with tasks.
Type git branch -a to ensure you see in a list lines like remotes/upstream/hometasks-....
Assuming the new branch (with new tasks you haven't solved yet) is hometasks-simple-tasks.
Type git switch hometasks-simple-tasks. If you see two messages
Branch 'hometasks-simple-tasks' set up to track remote branch 'hometasks-simple-tasks' from 'upstream'
Switched to a new branch 'hometasks-simple-tasks'
Then you did it correctly.
Now the next step is to publish that branch into your Git repositry (origin). Run command git push -u origin. You should see a list of messages containing that line:
...
To github.com:YOUR_NAME/js-ts-tasks.git
* [new branch] hometasks-simple-tasks -> hometasks-simple-tasks
...
You're done, now you could write solutions for your task.
Now when the linking is created, In Source Control menu click on three dots -> Pull, Push -> Fetch From All Remotes menu item to get a new branch with tasks.
Then checkout/switch to that branch (upstream/hometasks-...)
Now you could create your solution locally.
To prepare for Autocode submit please push your local branch into your repository. In Source Control menu click on three dots -> Pull, Push -> Push to... -> Select origin (not upstream)
Sometimes there are improvements in already published tasks. To get new changes from upstream repository you should use git pull command.
For example, let's assume there are some updated in upstream/hometasks-simple-tasks branch. Run in console git pull upstream hometasks-simple-tasks to pull recent changes from remote branch into your local repository.
- You need to execute the command npm install in the console. (1 time step)
- Switch to the tasks branch you would like to solve
- Each task has its own instructions in README.md
- to run test localy you need to execute the proper command in the console e.g. npm run test:local:digitSum
- Develop a solution
- Commit your solution. You need to follow the next commit message pattern:
feat: {commit message}orfix: {commit message}e.g.feat: solved task 1orfix: fixed commentsfor task 3 - Push your solution to your forked repository
- Submit a link to the branch with solution in your forked repository to the moodle