Feature proposal: sftp context by git branch
See original GitHub issueJust a proposal, maybe you like it
Example config
[
{
"context-git-branch": "master",
"remotePath": "/remote/public_html",
(...)
},
{
"context-git-branch": "dev",
"remotePath": "/remote/staging",
(...)
}
]
So when switching branches, the sftp context would change as well
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Feature branch workflow - GitLab Docs
Feature branch workflow. all tiers ; Clone project: git clone git@example.com:project-name.git ; Create branch with your feature: git checkout -b feature_name.
Read more >Git - Branching Workflows - Git SCM
This technique allows you to context-switch quickly and completely — because your work is separated into silos where all the changes in that...
Read more >Site deploys overview - Netlify Docs
There are four predefined deploy contexts: production : this context corresponds to the main site's deployment, attached to the Git branch you set...
Read more >Git Magic - Chapter 4. Branch Wizardry
Branch Wizardry. Instant branching and merging are the most lethal of Git's killer features. Problem: External factors inevitably necessitate context switching.
Read more >Manage Git branches | PyCharm Documentation - JetBrains
In the Log view, select the commit that you want to act as a starting point for the new branch and choose New...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks! I’m now using different config files, like this
And depending on the context I just paste the content of one of the first files into sftp.json (much more robust than renaming all the time)
So probably in the post-checkout-hook it would only need something like
cp .vscode/sftp-{branchname} .vscode/sftp.json
Not depending on the git branch, but here’s a working example for SFTP with multiple profiles (on mac with pubkey, same server).