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

Add option to auto push when committing #14885

Closed
EmmanuelBeziat opened this issue Nov 2, 2016 · 6 comments
Closed

Add option to auto push when committing #14885

EmmanuelBeziat opened this issue Nov 2, 2016 · 6 comments
Labels
feature-request Request for new features or functionality git GIT issues
Milestone

Comments

@EmmanuelBeziat
Copy link

EmmanuelBeziat commented Nov 2, 2016

Hi,

I feel there should be an option to allow push automatically after a commit, without having to click manually on the bottom buttons.

Something like this, maybe?

{
    // Automatically perform a git push after a commit
    "git.autoPush": true
}

Thanks! 😃

@coreh
Copy link

coreh commented Nov 2, 2016

Not a VSCode feature, but you can achieve this behavior by using a post-commit git hook that does git push:

https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

@rebornix
Copy link
Member

rebornix commented Nov 3, 2016

Close as there is a standard way to do this in Git.

@rebornix rebornix closed this as completed Nov 3, 2016
@EmmanuelBeziat
Copy link
Author

@rebornix Sorry, but I don’t get your point here…

This is not about having a way to do this already or not… I mean, there are standard ways to do commit, pull, push, merge, diffs; and yet, these are implemented in VScode "the easy way".

So, I feel this isn’t about "is there already a way to do this with some other tool or not", but "Would such an option be uesful to users?".

Now if you tell me "we think nobody but you have any interest on this feature, thus we don't want to waste timework on this", I'm fully okay with that. But I can't just be okay with "we don't implement features if there are other ways to do it", otherwithe I'd be pretty happy with the simple Notepad, as there are other ways to do git commands, running tasks, validate code, preview files, and so on.

Thanks anyway :)

@rebornix
Copy link
Member

rebornix commented Nov 3, 2016

@EmmanuelBeziat sorry for the misleading, let me do a better clarification.

This feature is quite similar to pre commit checks. Some ppl want to make sure linting or tests pass before they make a commit so they put things into pre-commit hook file. And then if they try to commit in Code or in terminal, both Code and Terminal will not commit if the pre-commit fail because it's all done by Git. Code doesn't know what you put in the pre-commit file and it just follows Git's default behavior.

That's also the same for auto push. You may just want to push current branch to remote always so it's a single line of script in post-commit hook file. For this particular request, a autoPush is enough. But some users may want to do a rebase before they push to remote, or they may not want to have the same name in their remote, it makes the post-commit a little bit complicated but you can always to that. But a auto-push no longer works in these cases.

That's basically why personally I suggest to leverage git's hooks instead of implementing these features again in Code as they are not just a single option.

I'll reopen this first and see @joaomoreno 's input on this.

@EmmanuelBeziat
Copy link
Author

EmmanuelBeziat commented Nov 4, 2016

@rebornix Okay, thanks for the explanations. I got it better.

So, if I want this possibility, the nice answer for me would be making an extension, right? I could give it a try, but I just wanna know if you think this is possible or not in the first place? I don’t know how much "power" extensions can have on built-in functions.

Thanks!

@joaomoreno joaomoreno added this to the Backlog milestone Nov 4, 2016
@joaomoreno joaomoreno added feature-request Request for new features or functionality git GIT issues labels Nov 4, 2016
@joaomoreno joaomoreno removed their assignment Nov 4, 2016
@joaomoreno
Copy link
Member

joaomoreno commented Nov 4, 2016

Yeah... I'd absolutely recommend the post-commit hook, it is by far the best option. It comes with the added benefit that if you ever commit from the command line outside of VS Code, you'll still benefit from the automatic push.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues
Projects
None yet
Development

No branches or pull requests

4 participants