Git & GitHub– Assignment– 4

Basic Questions

  1. Create a lightweight tag named v1.0 in your local repository.
  2. Create an annotated tag v2.0 with message “Release version 2.0”.
  3. Show the command to list all tags in the repository.
  4. View details of an annotated tag named v2.0.
  5. Delete a local tag named v0.5.
  6. Push a single tag v1.0 to the remote repository.
  7. Push all tags from local to remote in one command.
  8. Show how to check which commit a tag v2.0 is pointing to.
  9. Create a GitHub release from an annotated tag v3.0 using CLI.
  10. Show the command to rename tag v1.0 to v1.0.1.
  11. Create issue #1 with title “Bug in login feature” using GitHub CLI.
  12. Assign issue #1 to yourself using GitHub CLI.
  13. Add label “high-priority” to issue #1 using GitHub CLI.
  14. Close issue #1 from CLI after resolving it.
  15. List all open issues in the current repository using CLI.
  16. Create a new branch hotfix-login, fix code, and link it to issue #2 via commit message.
  17. Show how to reopen a closed issue #5 via CLI.
  18. Run command to list milestones in a repo using GitHub CLI.
  19. Create milestone “Phase-1” and assign issue #3 to it using CLI.
  20. Show command to lock conversation on issue #6 via CLI.

Intermediate Questions

  1. Rebase branch feature1 onto main and update history.
  2. Abort an ongoing rebase operation in Git.
  3. Resolve a rebase conflict manually and continue the rebase.
  4. Show command to rebase interactively for last 3 commits.
  5. Run command to squash last 2 commits into one using interactive rebase.
  6. Cherry-pick commit with hash abc123 onto current branch.
  7. Cherry-pick multiple commits (abc111, abc222) onto a branch.
  8. Abort a cherry-pick operation in Git.
  9. Use git stash to temporarily save changes in working directory.
  10. Show how to apply the most recent stash without deleting it.
  11. Apply and drop the latest stash in a single command.
  12. List all available stashes in your repository.
  13. Show command to stash changes with message “UI Fix”.
  14. Pop a stash with index stash@{2}.
  15. Drop a specific stash with index stash@{1}.
  16. Stash only untracked files in your repo.
  17. Amend last commit message from “Initial” to “Initial Commit”.
  18. Amend last commit to include a missed file app.js.
  19. Show how to squash 4 commits into a single commit while rebasing.
  20. Edit commit message of commit abc456 during interactive rebase.

Advanced Questions

  1. Create annotated tag release-v1.5, push it to remote, and generate GitHub release with description.
  2. Simulate: Create 3 commits, stash uncommitted changes, checkout another branch, then apply stash.
  3. Run commands to cherry-pick a commit from feature-x branch into main and resolve conflicts.
  4. Show command to squash commits from abc111 to abc333 into one.
  5. Create issue “Add search bar”, assign to user dev123, and link milestone “UI-Update”.
  6. Simulate: Start rebase, encounter conflict, abort rebase, then restart it successfully.
  7. Amend a commit to change both author info and commit message.
  8. Create two annotated tags, push them, delete one locally and remotely.
  9. Simulate: Push code with wrong commit message, amend it, force-push corrected commit.
  10. Write commands to stash changes, switch branch, pop stash, and commit changes in new branch.