feat: add netlify push for git-based deploys via Netlify-hosted git#7949
Draft
feat: add netlify push for git-based deploys via Netlify-hosted git#7949
netlify push for git-based deploys via Netlify-hosted git#7949Conversation
e194d8d to
43aeca5
Compare
Introduce a new deploy workflow using Netlify-hosted git repositories: - `netlify init --git`: configures a site to use Netlify's git provider, sets up the `netlify` remote, and wires up a credential helper in `./.git/config` for seamless git operations - `netlify push`: stages, commits, and pushes to the Netlify remote (which will trigger a build/deploy) - `netlify git-credentials` (hidden): git credential helper that provides the Netlify auth token for push authentication Adds `@clack/prompts` for pretty CLI UX. We've been meaning to do this for years and I'd rather not keep spreading our current patterns. The dependency weight is very small.
43aeca5 to
d94682b
Compare
serhalp
commented
Feb 16, 2026
| 'Configure continuous deployment for a new or existing project. To create a new project without continuous deployment, use `netlify sites:create`', | ||
| ) | ||
| .option('-m, --manual', 'Manually configure a git remote for CI') | ||
| .option('--git', 'Use Netlify-hosted git for deploys (no external provider needed)') |
Member
Author
There was a problem hiding this comment.
TBD: what should this be called? Confusingly, --manual already exists and means something completely unrelated to "manual deploys".
Should this even be opt-in (eventually)?
serhalp
commented
Feb 16, 2026
|
|
||
| export const createPushCommand = (program: BaseCommand) => | ||
| program | ||
| .command('push') |
Member
Author
There was a problem hiding this comment.
TBD: what should this be called? should this even be separate from netlify deploy? how exactly does the currently checked out branch come into play?
serhalp
commented
Feb 16, 2026
| .description('Push code to Netlify via git, triggering a build') | ||
| .option('-m, --message <message>', 'Commit message') | ||
| .addExamples(['netlify push', 'netlify push -m "Add contact form"']) | ||
| .action(async (options: OptionValues, command: BaseCommand) => { |
Member
Author
There was a problem hiding this comment.
fixme: use the good pattern for typing options
serhalp
commented
Feb 16, 2026
| const repo = { | ||
| provider: 'netlify-git', | ||
| repo_branch: 'main', | ||
| allowed_branches: ['main'], |
Member
Author
There was a problem hiding this comment.
Suggested change
| allowed_branches: ['main'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
See https://link.excalidraw.com/l/1lDRWjiHP6a/8g721X5zal0 and https://www.notion.so/netlify/Discovery-Netlify-code-hosting-2fe1da88359a808e968bd68797af8d69 for context.
Introduce a new deploy workflow using Netlify-hosted git repositories:
netlify init --git: configures a site to use Netlify's git provider, sets up thenetlifyremote, and wires up a credential helper in./.git/configfor seamless git operationsnetlify push: stages, commits, and pushes to the Netlify remote (which will trigger a build/deploy)netlify git-credentials(hidden): git credential helper that provides the Netlify auth token for push authenticationAdds
@clack/promptsfor pretty CLI UX. We've been meaning to do this for years and I'd rather not keep spreading our current patterns. The dependency weight is very small.