Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix status() for case where there is no remote repo #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phlkchan
Copy link

When working in a git repo without a remote branch, "gg s" will output errors like:

$ gg s
fatal: no upstream configured for branch 'master'
[master -> /master|0220999] init commit, example.html from webtorrent.io Get Started page

fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.
fatal: no upstream configured for branch 'master'
fatal: no upstream configured for branch 'master'
fatal: no upstream configured for branch 'master'
fatal: ambiguous argument 'master.../master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
position |  commits ahead of remote (push)
staging  | not all changes staged (add changes)
commits  | all changes committed

commits ahead (to push):
Could not find a tracked remote branch, please specify <upstream> manually.
usage: git cherry [-v] [<upstream> [<head> [<limit>]]]

    --abbrev[=<n>]        use <n> digits to display SHA-1s
    -v, --verbose         be verbose

 [master|]

files modified:
 |- example.html

Simple fix by checking if "git remote" outputs anything, if not, don't do anything that's related to remote repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant