Skip to content

Add feature to commands that you aren't running on latest version of deployment #55

@bayangan1991

Description

@bayangan1991

Common gotcha is the people are running commands on old version of deployments, so migrations are not being run correctly.

Add a prompt to confirm with the user that they are aware they are running on an old version of their deployment would prevent this from being a common issue.

The git commands are options below would fetch this information.

git status

Has the advantage of automatically checking against the set tracking branch, the check code can then find the presence of behind in the output

$ git fetch
$ git status -sb
## master...origin/master [behind 1]

git rev-list

Displays a simple count of commits not on local branch, but is limited to an explicitly set branch

$ git fetch
$ git rev-list ..origin/master | wc -l
        1

Could be improved by using the current branch name, but opens the rabbit hole of figuring out the correcting tracking branch

$ git rev-list ..origin/$(git symbolic-ref --short HEAD) | wc -l

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions