Skip to content

Latest commit

 

History

History
51 lines (29 loc) · 2.55 KB

06-basic-knowledge-solution.md

File metadata and controls

51 lines (29 loc) · 2.55 KB

To solve the given Github assignment, follow these steps:

Step 1:

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".

Step 2:

Give your repository a name "learnjavascript" and tick the ".readme" checkbox to create a README.md file.

Step 3:

In the "Description" field, write "Training Repository".

Step 4:

Clone this repository to your local machine by using the command "git clone " in your terminal.

Step 5:

Navigate to the repository folder on your local machine using your terminal by using the command "cd ".

Step 6:

Add three new files to your repository: index.html, style.css, script.js using the command "touch ".

Step 7:

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'".

Step 8:

Create a new branch using the command "git branch ".

Step 9:

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'".

Step 10:

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 ".