Login to Github and create a new repository by clicking on the "+" icon on the top-right corner of the screen, then selecting "New repository".
Give your repository a name "learnjavascript" and tick the ".readme" checkbox to create a README.md file.
In the "Description" field, write "Training Repository".
Clone this repository to your local machine by using the command "git clone " in your terminal.
Navigate to the repository folder on your local machine using your terminal by using the command "cd ".
Add three new files to your repository: index.html, style.css, script.js using the command "touch ".
- Add five commits as follows:
In the first commit, add index.html using the command "git add index.html" and then commit the changes using the command "git commit -m 'added index.html file'".
In the second commit, add style.css file using the command "git add style.css" and then commit the changes using the command "git commit -m 'added style.css file'".
In the third commit, add script.js file using the command "git add script.js" and then commit the changes using the command "git commit -m 'added script.js file'".
In the fourth commit, modify script.js file using the command "git add script.js" and then commit the changes using the command "git commit -m 'modified script.js file'".
In the fifth commit, delete style.css file using the command "git rm style.css" and then commit the changes using the command "git commit -m 'deleted style.css file'".
Create a new branch using the command "git branch ".
Switch to the new branch using the command "git checkout " and then add three commits as follows:
In the first commit, add style.css file using the command "git add style.css" and then commit the changes using the command "git commit -m 'added style.css file'".
In the second commit, add other.html file using the command "touch other.html" and then commit the changes using the command "git commit -m 'added other.html file'".
In the third commit, modify index.html file using the command "git add index.html" and then commit the changes using the command "git commit -m 'modified index.html file'".
Switch back to the main branch using the command "git checkout main" and then verify the changes made in the new branch using the command "git log " or "git diff "