Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Exercises for GECS course (github)

Warning

The below commands are intended for people who understand git usage. Please do not run them if you are not really familiar with what is going on.

Exercise part-1

  1. Run below command to restart git
rm -rf .git
git init
  1. Change madlibs.txt, by filling in Author section.

  2. After your changes, add you madlibs.txt to git.

git add madlibs.txt
git status
  1. After staging your changes, commit your changes.
git commit -m 'initial commit'
git status
  1. Checkout your current git commits.
git status
git log
  1. Change your file again, this time filling in parentheses.

  2. Stage, then commit.

git add madlibs.txt
git commit -m 'Updated text in madlibs.txt'
  1. Checkout your last commit.
git log
git checkout [commit hash]
  1. Get back to your main branch.
git checkout main

Exercise part-2

  1. Create new branch.
git branch change_noun
git checkout change_noun
  1. Change a critical noun in your madlibs.txt.

  2. Stage, commit, and return to main branch.

git add madlibs.txt
git commit -m 'Changed noun [A] to [B]'
git checkout main
  1. Repeat step 1-3. Change the same noun you did last time but to another one.
git branch change_another_noun
git checkout change_another_noun
# Update your file.
git add madlibs.txt
git commit -m 'Changed noun [A] to [C]'
git checkout main
  1. Merge your first branch to main.
git merge change_noun
  1. Merge your second branch to main.
git merge change_another_noun
  1. Resolve conflicts, stage and commit.
git status
# correct conflict
git add madlibs.txt
git commit

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors