Skip to content

raghuck/git-basics-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

git-basics-practice

This is an empty repo to practice git commands Below are the assignments to practice. Please let me know if you get any issues.

Put relevant git commands beside the each steps and create a document as part of learning.

Assignment 1:

  1. On your GitHub account, fork this repo https://github.com/raghuck/git-basics-practice
  2. Clone the forked repo from your account on to your local
  3. Navigate inside the cloned folder
  4. Check the current branch of the cloned folder
  5. heck the remote repo of the cloned folder
  6. Pull the changes
  7. Create a new branch named “feature1”
  8. Switch to the newly created branch
  9. Verify you are in the new branch
  10. Create a new file named homepage.html and put some sample content in it
  11. Check the status of the changes
  12. Add the new file to staging area
  13. Commit the new changes
  14. Push the new changes to feature1 branch
  15. On the Github dashboard, change to feature1 branch
  16. Verify the new changes appear in the Github repo dashboard

Assignment 2:

  1. On the Github dashboard, create a new branch named “dev” by selecting source as the master branch
  2. Create a Pull request to merge the feature1 branch to dev branch
  3. Go to Pull requests, then approve and merge the changes
  4. Change to the dev branch
  5. Verify the merge changes are visible in the dev branch
  6. On your local terminal, List the branches
  7. Pull the changes to your local
  8. Switch to the dev branch
  9. List the branches and see that current branch should be dev
  10. Verify the merged changes are present in the dev branch in the local terminal

Assignment 3:

  1. On the Github dashboard, create a new branch named “feature2” by selecting source as the master branch
  2. On your local terminal, pull the changes to your local
  3. Switch to the feature2 branch
  4. Create a new file named aboutus.html with put some sample content in it
  5. Check the status of the changes
  6. Add a new file to staging area
  7. Commit the new changes
  8. Push the new changes
  9. On the Github dashboard, verify the new pushed changes are visible in the feature2 branch
  10. Create a Pull request to merge the feature2 branch to dev branch
  11. Go to Pull requests, then approve and merge the changes
  12. On your local terminal, pull the changes to your local
  13. Switch to the dev branch
  14. Verify the merged file is visible in the terminal in the dev branch

Assignment 4:

  1. On the Github dashboard, create a new branch named “stage” by selecting source as the master branch
  2. Create a Pull request to merge the dev branch to stage branch
  3. Go to Pull requests, then approve and merge the changes
  4. Change to the stage branch
  5. Verify the merge changes are visible in the stage branch
  6. On your local terminal, pull the changes to your local
  7. Switch to the stage branch
  8. Verify the merged file is visible in the terminal in the stage branch

Assignment 5:

  1. On the Github dashboard, create a new branch named “feature3” by selecting source as the main branch
  2. On your local terminal, pull the changes to your local
  3. Switch to the feature3 branch
  4. Verify you are in the feature3 branch
  5. Create a new file named aboutus.html with put some sample different content in it
  6. Check the status of the changes
  7. Add the new file to staging area
  8. Commit the new changes
  9. Push the new changes to feature3 branch of Github
  10. On the Github dashboard, verify the new changes are visible in the feature3 branch
  11. Create a Pull request to merge the feature3 branch to dev branch

You will see merge conflicts which won’t allow you to merge from the GitHub dashboard. We have to resolve merge conflicts and then merge from the dashboard. Otherwise we can force merge from the terminal. Let's try that. 13. On your local terminal, pull the changes to your local 14. Switch to dev branch 15. Verify you are in the dev branch 16. Merge the branches from the feature3 branch to dev branch 17. Verify the merge changes are visible in the dev branch 18. Push the merged changes 19. On the Github dashboard, verify the merged file changes are visible in the Github repo dashboard of dev branch

Assignment 6:

  1. On the Github dashboard, create a Pull request to merge the dev branch to stage branch
  2. Go to Pull requests, then approve and merge the changes
  3. Change to the stage branch
  4. Verify the merge changes are visible in the stage branch
  5. On your local terminal, pull the changes to your local
  6. Switch to the stage branch
  7. Verify the merged file is visible in the terminal in the stage branch
  8. Check the git logs for the commit hash
  9. Revert back to the commit made in the assignment4
  10. Check the git logs to see the previous reverted commit hash
  11. Force push the changes to Github to overwirte the head
  12. Verify the reverted changes are visible in the terminal in the stage branch
  13. On the Github dashboard, verify the reverted changes are visible in the GitHub dashboard

About

This is an empty repo to practice git commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published