Git & GitHub– Assignment– 4
Basic Questions
- Create a lightweight tag named v1.0 in your local repository.
- Create an annotated tag v2.0 with message “Release version 2.0”.
- Show the command to list all tags in the repository.
- View details of an annotated tag named v2.0.
- Delete a local tag named v0.5.
- Push a single tag v1.0 to the remote repository.
- Push all tags from local to remote in one command.
- Show how to check which commit a tag v2.0 is pointing to.
- Create a GitHub release from an annotated tag v3.0 using CLI.
- Show the command to rename tag v1.0 to v1.0.1.
- Create issue #1 with title “Bug in login feature” using GitHub CLI.
- Assign issue #1 to yourself using GitHub CLI.
- Add label “high-priority” to issue #1 using GitHub CLI.
- Close issue #1 from CLI after resolving it.
- List all open issues in the current repository using CLI.
- Create a new branch hotfix-login, fix code, and link it to issue #2 via commit message.
- Show how to reopen a closed issue #5 via CLI.
- Run command to list milestones in a repo using GitHub CLI.
- Create milestone “Phase-1” and assign issue #3 to it using CLI.
- Show command to lock conversation on issue #6 via CLI.
Intermediate Questions
- Rebase branch feature1 onto main and update history.
- Abort an ongoing rebase operation in Git.
- Resolve a rebase conflict manually and continue the rebase.
- Show command to rebase interactively for last 3 commits.
- Run command to squash last 2 commits into one using interactive rebase.
- Cherry-pick commit with hash abc123 onto current branch.
- Cherry-pick multiple commits (abc111, abc222) onto a branch.
- Abort a cherry-pick operation in Git.
- Use git stash to temporarily save changes in working directory.
- Show how to apply the most recent stash without deleting it.
- Apply and drop the latest stash in a single command.
- List all available stashes in your repository.
- Show command to stash changes with message “UI Fix”.
- Pop a stash with index stash@{2}.
- Drop a specific stash with index stash@{1}.
- Stash only untracked files in your repo.
- Amend last commit message from “Initial” to “Initial Commit”.
- Amend last commit to include a missed file app.js.
- Show how to squash 4 commits into a single commit while rebasing.
- Edit commit message of commit abc456 during interactive rebase.
Advanced Questions
- Create annotated tag release-v1.5, push it to remote, and generate GitHub release with description.
- Simulate: Create 3 commits, stash uncommitted changes, checkout another branch, then apply stash.
- Run commands to cherry-pick a commit from feature-x branch into main and resolve conflicts.
- Show command to squash commits from abc111 to abc333 into one.
- Create issue “Add search bar”, assign to user dev123, and link milestone “UI-Update”.
- Simulate: Start rebase, encounter conflict, abort rebase, then restart it successfully.
- Amend a commit to change both author info and commit message.
- Create two annotated tags, push them, delete one locally and remotely.
- Simulate: Push code with wrong commit message, amend it, force-push corrected commit.
- Write commands to stash changes, switch branch, pop stash, and commit changes in new branch.