Skip to content

[Exercise Discussion] T4L2/tags-push #63

@damithc

Description

@damithc

Existing exercise check

Lesson

https://nus-cs2103-ay2526s1.github.io/website/book/gitAndGithub/tag/

Exercise learning outcomes

Able to push commits to a remote repo.
Able to delete tags in a remote repo.

Exercise setup

Inputs to the new.sh:

Exercise name: tags-push
Tags (space separated): git-tag
Requires Git? (defaults to y)  [y/N]: y
Requires Github? (defaults to y)  [y/N]: y
Exercise repo type (local, remote, or ignore) (defaults to 'local'): remote
Exercise repo name (defaults to 'view_commits'): duty-roster
Git-Mastery Github repository title (defaults to ''): gm-duty-roster
Initialize exercise repo as Git repository? (defaults to y)  [y/N]: N

Fork git-mastery/gm-duty-roster as {username}-duty-roster and clone the fork as duty-roster.
Rename the remote from origin to production.

# create a tag, push it to the fork, and delete it locally
git tag beta
git push production --tags
git tag -d beta

# create two more tags
git tag v1.0 HEAD~4
git tag -a v2.0 HEAD~1 -m "First stable roster"

Instructions for students

Scenario: The duty-roster repo contains text files that track which people are assigned for duties on which days of the week. This repo is backed up in a remote named production. Apparently, tags in the local repo are not in sync with the tags in your remote. You intend to rectify this situation as follows:

Task:

  1. Push both tags in the local repo to the remote.
  2. If any tags are present in the remote production but not in the local repo (i.e., likely result of you previously deleting them in the local repo but forgetting to delete them in the remote repo), delete them in the remote.

Exercise grading

Verify that,

  • both local tags are pushed to the repo.
  • the beta tag is deleted from the remote.

Requires remote repository?

https://github.com/git-mastery/gm-duty-roster

Additional remarks

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions