WASDEV(The AI WorkShop)Docs Website Download

Chapter 8

Git and GitHub

Keep the history of your project: commit, branches, synchronise with GitHub, pull requests and conflict resolution.

Start version control

The Git view: changed files and the commit box
The Git view: changed files and the commit box
  1. Click the Git icon in the activity bar, or press Ctrl+Shift+G.
  2. If Git is not on the PC, click Install Git.
  3. Open More Git actions and click Initialize a Git repository.
  • To copy an existing project instead, choose Clone a repository (GitHub / URL)… and paste its address.

Commit your changes

The difference of a changed file: the old version on the left, the new version on the right
The difference of a changed file: the old version on the left, the new version on the right
  1. In the Git view, look at the group Changes: every modified file is listed.
  2. Click a file to see what changed.
  3. Click Stage on each file to include, or stage everything. The files move to Staged changes.
  4. Type a message in the commit box, for example Add the contact page.
  5. Click Commit, or press Ctrl+Enter.
  • Commit & Push commits and sends to the server in one step.
  • Amend last commit adds your changes to the previous commit.
  • Discard changes… returns a file to its last committed state. This cannot be undone.

Work with branches

The branch menu: create a branch or switch to another one
The branch menu: create a branch or switch to another one
  1. Open the branch actions and click New branch…. Type a name.
  2. Work and commit on the branch.
  3. To bring the work back, switch to the main branch and click Merge into current branch.
  4. Delete a branch removes a branch you no longer need.

Synchronise with GitHub

Connecting WASDEV to GitHub with an access token
Connecting WASDEV to GitHub with an access token
Cloning a repository from GitHub or from an address
Cloning a repository from GitHub or from an address
  1. Open More Git actions and click Connect GitHub (token)….
  2. Paste a personal access token created in your GitHub account settings.
  3. Click Sync (pull + push) to receive and send changes.
  • Fetch only checks what is new on the server.
  • Stash changes puts your unfinished work aside; Pop stash brings it back.

Create a pull request

The pull request form
The pull request form
  1. Push your branch.
  2. Open More Git actions and click Create a Pull Request….
  3. Fill the title and the description, then confirm.
  • View open PRs lists the pull requests of the repository.

Read the history

The history of commits, with the files of a commit
The history of commits, with the files of a commit
  1. Scroll to HISTORY in the Git view.
  2. Click a commit to see its changes.
  3. Right-click a commit for Copy SHA, Create a branch here…, Revert this commit and View on GitHub.
  • File history on a file shows only the commits that touched it.

Resolve a conflict

A conflict in the editor: your version in green, the incoming version in blue
A conflict in the editor: your version in green, the incoming version in blue

When two changes touch the same lines, the file appears under Conflicts.

  1. Click the file. A bar appears above the editor.
  2. For each conflict, click Yours, Theirs or Both.
  3. Click Next conflict to continue, or All to apply the same choice everywhere.
  4. Click Resolved, then commit.