Skip to content

02. GIT. Local

Siarhei P edited this page Dec 19, 2024 · 10 revisions

Homework Assignment 1: Initializing a Local Repository

  1. Create a new directory on your local machine.
  2. Navigate to the newly created directory using the command line.
  3. Initialize a new Git repository in this directory.
  4. Create a new file named README.md and add some content to it.
  5. Stage and commit the README.md file to the repository.

Homework Assignment 2: Basic Version Control

  1. Create a new branch named feature-branch.
  2. Edit the README.md file to add a brief description of your project.
  3. Commit your changes to the feature-branch.
  4. Switch back to the main branch (usually master or main).
  5. Merge the changes from feature-branch into the main branch.

Homework Assignment 3: Exploring Git History

  1. Use the git log command to view the commit history of your repository.
  2. Identify the commit hashes, dates, and commit messages.
  3. Try using different formatting options for git log to customize the output.
  4. Use git show <commit-hash> to view the details of a specific commit.

Homework Assignment 4: Creating and Applying Tags

  1. Create a tag named v1.0 on a specific commit in your repository's history.
  2. Verify that the tag has been created successfully.
  3. Make some additional changes to the README.md file and commit them.
  4. Create a new tag named v2.0 on the latest commit.
  5. Explore the difference between annotated and lightweight tags.

Homework Assignment 5: Undoing Changes

  1. Create a new branch named bug-fix.
  2. Make a change to the README.md file and commit it.
  3. Make another change and commit it.
  4. Use git reset to undo the most recent commit while keeping the changes.
  5. Explore the effects of git reset with different options (soft, mixed, hard).

Homework Assignment 6: Stashing Changes

  1. Create a new branch named experimental-feature.
  2. Make some changes to the README.md file but do not commit them.
  3. Use git stash to temporarily store your changes.
  4. Switch to "another branch" and make a different set of changes.
  5. Apply the changes from the stash to the "another branch" branch.

Homework Assignment 7: Git Aliases and Configuration

  1. Configure your Git username and email globally.
  2. Set up a custom alias for a frequently used Git command.
  3. Use the git config command to verify your configuration changes.

All your commands put into files 02.GIT.Local.md and add to your forked repository sa.it-academy.by, then prepare PR (Pull Request)

IMPORTANT!!! Use git markdown for your report. See link

Additional: Create README.md with project description in your folder. You will be maintain its during our course till the final demo

To read