Skip to main content

Git and source control

Each module has a Git repository. Git records versions of your code and lets you work on branches, share changes with collaborators, and choose which code to deploy.

Your development machine has a local checkout. The module's hosted repository is the shared copy, normally configured as the origin remote.

Save, commit, push, deploy​

ActionWhat it changes
SaveWrites an editor change to your development workspace.
StageSelects file changes for the next commit.
CommitRecords the staged changes in your local Git history.
PushSends local commits to the hosted repository.
DeployBuilds and runs code from the configured branch in the hosted repository.

A local commit is not yet available to other collaborators or the deployment builder. Push it when you want to share or publish it.

Review and commit your work​

  1. Save your edited files and open Source control.
  2. Select a changed file to inspect its diff.
  3. Stage the files you want in the next commit. They move from Changes to Staged Changes.
  4. Open the commit dialog, enter a message that describes the change, and commit.
  5. Push the commit, or select the dialog's option to push after committing.

If nothing is staged, the commit dialog offers to stage and commit all changes. Check that summary carefully, especially if the workspace contains unrelated work.

Keep credentials, local environment files, dependency folders, and generated files out of commits unless they genuinely belong in the repository. Use .gitignore where appropriate, and review the staged diff before pushing.

Branches​

A branch gives a piece of work its own line of development. Use the branch control in Source control to switch to an existing branch or enter a new branch name.

For example, work on invoice-search while the production deployment continues to use main. Test and review the work before integrating it into the branch you deploy.

Commit or otherwise preserve unfinished changes before switching branches. Git may refuse a switch that would overwrite them. Creating or switching a branch does not update the live application.

Synchronise with the repository​

Source control provides the following actions:

  • Fetch downloads remote information without integrating it into your current branch.
  • Pull brings remote changes into your current branch.
  • Push uploads local commits to the branch's upstream.
  • Publish branch creates the remote branch when it does not yet have an upstream.
  • Sync pulls and then pushes.

Collaborators have separate development workspaces. Fetch and pull to receive their changes; saving your own files does not synchronise their editors.

If Git reports conflicts, review the affected files under Merge Changes and resolve the competing edits. Test the result, stage the resolved files, and complete the operation. Ask the agent to explain a conflict if needed, but do not resolve it by discarding somebody else's work without reviewing it.

Destructive Git actions

Discarding changes can remove work that was never committed. Force-pushing can rewrite history other people depend on. Use these actions deliberately, and preserve any work you need before proceeding.

Work from your own computer​

The repository/clone dialog in Source control provides the module's repository URL and controls for a Git credential. You can use it to clone the same repository onto your own computer and work with your preferred local tools.

The credential grants access to that module's repository. Copy a newly generated credential when it is shown, check its expiry, and treat a credential-bearing clone URL as a secret. Git can store that URL in the local clone's configuration, so do not paste it into screenshots, logs, or shared documentation.

Revoking the credential stops clones using it from pushing or pulling. A replacement credential must be configured in those clones. Changes pushed from your computer still need to be pulled into an existing development workspace; they do not automatically deploy.

Download a ZIP​

Source control can export the current workspace, including uncommitted and unpushed file changes. The ZIP does not include the .git history.

Choose whether to skip Git-ignored files or include everything in the workspace. Review the contents before sharing: an export that includes ignored files may contain secrets or large dependency folders.

Use a Git clone when you need version history; use a ZIP when you need a copy of the files as they are now.