IFS Git for IBM i
Use VS Code's Source Control view with git repositories that live in the IFS on IBM i.
VS Code's built-in Git (and Remote - SSH) cannot work with IBM i: the VS Code Server does not run in PASE,
and files opened through Code for IBM i are not on a local disk. This extension fills the gap:
it runs git in PASE over the SSH connection of Code for IBM i
and shows the results in the standard Source Control view. Files are opened and saved through Code for IBM i.
Typical use: a Node.js, Python or ILE project cloned with git clone in PASE, edited directly in the IFS
(for example while nodemon runs on the IBM i), with full git support in VS Code.
Features
- Source Control groups: Merge Changes, Staged Changes, Changes, Untracked Changes
- Diff views (index ↔ IFS file, HEAD ↔ index) and change markers in the editor gutter (quick diff)
- Stage, unstage and discard single files or whole groups
- Commit (
Ctrl+Enter), amend, optional "smart commit" when nothing is staged
- Current branch in the status bar: checkout local/remote branches and tags, create branches
- Fetch, pull, push, publish (push with upstream), sync (pull + push), stash / stash pop
- Status letters (M, A, D, U, …) in the Explorer and on editor tabs
- Open, unmodified editors are reloaded after checkout, pull, discard and stash
- Repositories are remembered per system and user and reopened on the next connection
Requirements
- VS Code 1.90 or later
- Code for IBM i, connected to your IBM i
git in PASE (default /QOpenSys/pkgs/bin/git, installed from IBM i Open Source with yum install git)
Getting started
- Connect to your IBM i with Code for IBM i.
- Open a repository in one of these ways:
- in the IFS Browser, right-click a directory → Open Git Repository...
- run IFS Git: Open Git Repository... from the Command Palette and enter an IFS path
- just open a file from the repository – the repository is detected automatically (
ifsGit.autoDetect)
- Work in the Source Control view as usual.
Settings
| Setting |
Default |
Description |
ifsGit.gitPath |
/QOpenSys/pkgs/bin/git |
Path to git in PASE |
ifsGit.extraPath |
["/QOpenSys/pkgs/bin"] |
Directories prepended to PATH when running git |
ifsGit.autoDetect |
true |
Detect the repository when a stream file is opened |
ifsGit.autoRefreshInterval |
0 |
Refresh every N seconds (0 = only on save, on window focus and after git operations) |
ifsGit.enableSmartCommit |
false |
Commit all changes without asking when nothing is staged |
ifsGit.reloadOpenEditors |
true |
Reload open editors after operations that change files |
ifsGit.rememberCredentials |
true |
Remember remote credentials in VS Code's secret storage |
Authentication to the remote
fetch, pull and push are executed by git on the IBM i. When the remote (HTTP/HTTPS) asks for credentials,
VS Code prompts for the username and password or personal access token and retries the operation.
- Credentials are sent to git through the standard input of the SSH command and a small
GIT_ASKPASS helper
(~/.ifsgit-askpass-v1, which contains no secrets). They do not appear in command lines, logs or files on the IBM i.
- They are remembered in VS Code's secret storage (the OS credential manager) per remote, e.g.
https://git.example.com
(setting ifsGit.rememberCredentials). IFS Git: Forget Saved Credentials removes them.
- If a git credential helper or an SSH key is already configured in PASE, it is used as before.
Troubleshooting
- "git was not found on the IBM i" – install git from IBM i Open Source (
yum install git) or set
ifsGit.gitPath to the place where git is installed (which git in a PASE terminal shows it).
- "detected dubious ownership in repository" – the repository folder belongs to another user profile.
Run the
git config --global --add safe.directory ... command that git suggests in the message, in a PASE terminal.
- Repository not listed – open IFS Git: Show Git Output: every command sent to the IBM i and its result is logged there.
Known limitations
- Changes made outside VS Code (e.g.
git pull in a PASE terminal) appear after a refresh: the Refresh button,
saving a file, returning to the VS Code window, or ifsGit.autoRefreshInterval.
- Not yet available: 3-way merge editor, history, blame, choosing a stash.
- Files must be UTF-8 encoded; diffs of EBCDIC stream files are not supported.
- Every operation is an SSH command, so it is slower than git on a local disk.
The commands sent to the IBM i are logged in IFS Git: Show Git Output.
License
MIT
| |