Work with local Git

Review saved changes, stage selected files, inspect commits and switch local branches with Altifigence CLI.

Use Altifigence CLI 0.1.9 on Linux with an existing local Git project. Replace /home/me/design with its absolute directory and rtl/top.sv with your file.

Review changes

alti ide workspace git status --project /home/me/design
alti ide workspace git diff --project /home/me/design rtl/top.sv
alti ide workspace git history --project /home/me/design --limit 20 --skip 0

For a clean project on main, status returns:

{"branch":"main","changes":[],"ok":true,"staged":[],"unstaged":[],"untracked":[]}

History returns a commits array with each commit's id, parents, author, authoredAt and subject. Use --limit from 1 to 200 and --skip to move through history.

Stage and commit selected files

Save and review your file, then stage it and inspect its staged diff before committing.

alti ide workspace git stage --project /home/me/design rtl/top.sv
alti ide workspace git diff --project /home/me/design rtl/top.sv --staged
alti ide workspace git commit --project /home/me/design --message "Update top module"

Stage returns {"status":"staged"}. A successful commit returns {"status":"committed"}. To remove a file from the staging area, run:

alti ide workspace git unstage --project /home/me/design rtl/top.sv

Inspect commits and branches

Copy an id from history and replace COMMIT_ID with it. Read a commit, its saved file, the repository's refs and its worktrees:

alti ide workspace git commit-detail --project /home/me/design COMMIT_ID
alti ide workspace git commit-file --project /home/me/design COMMIT_ID rtl/top.sv
alti ide workspace git refs --project /home/me/design
alti ide workspace git worktrees --project /home/me/design

To switch to an existing local branch named review, save and commit your changes or preserve them separately, then run:

alti ide workspace git switch --project /home/me/design review

Resolve a rejected branch switch

For "save and commit or separately preserve local changes before switching branches", run status and review the changed files. Commit them or preserve them separately. Run status again, then retry the switch when the project is clean.

CLI first success