Skip to content

Commit

Permalink
Set the upstream remote branch when pushing
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
  • Loading branch information
westbury authored and akosyakov committed May 26, 2020
1 parent e64f70d commit ca6b505
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/git/src/browser/git-quick-open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class GitQuickOpenService {
await this.git.pull(repository, { remote: defaultRemote });
console.log(`Git Pull: successfully completed from ${defaultRemote}.`);
} else if (action === GitAction.PUSH) {
await this.git.push(repository, { remote: defaultRemote });
await this.git.push(repository, { remote: defaultRemote, setUpstream: true });
console.log(`Git Push: successfully completed to ${defaultRemote}.`);
}
} catch (error) {
Expand All @@ -165,7 +165,7 @@ export class GitQuickOpenService {
const [remotes, currentBranch] = await Promise.all([this.getRemotes(), this.getCurrentBranch()]);
const execute = async (item: QuickOpenItem) => {
try {
await this.git.push(repository, { remote: item.getLabel() });
await this.git.push(repository, { remote: item.getLabel(), setUpstream: true });
} catch (error) {
this.gitErrorHandler.handleError(error);
}
Expand Down

0 comments on commit ca6b505

Please sign in to comment.