Git

From changes to a commit

Diffs, selective staging, commit messages, history and reviewed Git operations.

In this guideBefore you start · PremiumReview before stagingGenerate and review a commit messageBranches, history and recoveryFrom a branch to a test remoteMerge a branch and resolve a conflictStash and restore selected changes

Before you start · Premium#

This guide covers tools included in Code Weaver Premium. Sign in to your account in the IDE and check that Premium is active. Without Premium you can still browse, search, edit and save your files.

Git: project changes and diff review.Code Weaver · Windows

Review before staging#

Ticking a checkbox does not stage a file by itself. Line and hunk staging applies to saved, tracked text files. New, deleted, binary or conflicted files use whole-file actions. If the file or index changes after a preview, prepare it again.

  1. Open Git from the side menu and check the active folder. You can also find the command with Ctrl+Shift+P.
  2. Open a file diff to review the changes.
  3. Select files, hunks or lines and use the explicit stage action.
  4. Review the staged changes, write the message and create the commit.

Generate and review a commit message#

AI commit-message generation uses the selected or staged diff and returns a suggestion. Choose the provider, model and supported effort, then review the response and apply it to the message field; that does not create the commit. Configure your AI connection in settings first.

Branches, history and recovery#

In the local build, expand Project & commands in the side menu and use Switch branch. Git → History filters commits and opens historical versions. Named stashes let you prepare and review a restoration; advanced operations such as cherry-pick, revert and rebase retain previews and recovery references.

Fetch refreshes remote references; pull and push remain explicit actions. Pull accepts fast-forward updates only. Authentication uses the Git credentials already configured on your PC.

From a branch to a test remote#

Before you start: active Premium, available Git, a repository with an initial commit and an already configured test remote. The remote can be your own local bare repository: this journey needs no Internet service. Configure your Git name and email and save drafts before operations that change files.

The first push of a branch without an upstream uses the single configured remote and establishes tracking. If several remotes exist and no upstream is set, configure the destination explicitly in Git before retrying. IDE push does not force a remote rewrite.

  1. In the local build, open Project & commands → Create branch. Enter New branch name, for example feature/vat-total, choose Continue and read the confirmation before creating the branch.
  2. Edit and save files, then open Git → Changes. Review the diff and stage files, hunks or lines within the supported scope; check that the second file remains unstaged if it should not be included.
  3. Write the message and create the commit. Open History and inspect the new commit’s files and differences before choosing Push and confirming the test remote.
  4. Use Fetch to refresh references without integrating remote work. If the branch needs to advance, choose Pull and review the confirmation: only fast-forward updates are allowed.
  5. Check the active branch, index and history. For the local exercise, also verify the commit in the remote repository you prepared.

Merge a branch and resolve a conflict#

Use a test repository with two branches and saved changes. The active branch is the merge destination; the branch selected in the dialog is the source. A conflict does not mean the merge was canceled: check the state before other operations.

  1. Switch to the destination branch, open Git and choose Merge a branch. Select Branch to merge, choose Continue and read the confirmation.
  2. If Conflicts to resolve appears, open a file. Compare Ours, Theirs and the editable Result; Show base adds the common version when available.
  3. Choose a Conflict block and use Accept ours, Accept theirs or Accept both; you can also edit the result. Check every block and remove markers before marking it resolved.
  4. To retain only the text, use Save result. When the file is ready, select Stage and mark resolved and choose Save and mark resolved. Return to Git, review the index and complete the merge commit when needed.
  5. If you decide to abandon the merge, use Cancel under Merge in progress and read the confirmation: changes made during the merge may be lost.

Stash and restore selected changes#

A stash concerns changes on disk: first save drafts you want included. Restoring does not delete the stash and can retain the original state of files already staged for commit.

  1. Open Git → Stash. Enter Name and choose whether to include untracked files; select Prepare stash.
  2. Read the files and differences, select I reviewed the files and differences and choose Stash changes.
  3. When ready to resume, choose Check and restore beside the stash. Select files to recover and review the diff, then confirm review and use Restore with the selected file count.
  4. Check the project index and files. If overlapping changes are reported, preserve current work and resolve the conflict before retrying. Remove stash requires separate confirmation and is permanent.
Open original image ↗