Skip to content

Git: Only pull/push if a remote is configured#4

Open
Terrance wants to merge 1 commit into
zefhemel:mainfrom
Terrance-forks:git-no-remote
Open

Git: Only pull/push if a remote is configured#4
Terrance wants to merge 1 commit into
zefhemel:mainfrom
Terrance-forks:git-no-remote

Conversation

@Terrance

Copy link
Copy Markdown

This guards sync, including auto-sync, from trying to pull/push in a repository with no remotes configured.

It's not foolproof (the branch may not be tracking a remote and git config may prevent automatic tracking setup), but will cover the simple case of having no remotes at all.

There's no API I can see to get a branch's tracking status directly, so something more clever would need a few commands to get a result, like git remote show -n $(git remote) or git config get branch.$(git branch --show-current).remote.

Fixes #3.

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.

Git: Support auto-commit without sync

1 participant