GitKraken

Install

  • Go to https://www.gitkraken.com/

  • Download and install the desktop version (free version is ok)

  • Login with your GitHub Student Developer Pack account

    • This should activate the Pro licence

Clone repository

Since the repository already exists on GitHub, you just need to clone it.

  • Select File > Clone Repo

    • Select a local folder like : c:UsersMeDesktopMyGit

    • Enter the address of the github repository

    • Clone the repository

    • The window closes itself, nothing special happens :)

Open repository

  • Select File > Open Repo

    • Select the folder repository inside : c:UsersMeDesktopMyGit

  • You can see:

    • The main interface of GitKraken

    _images/histo.png
    • Four commits with their comments on the right: upload/updated

    • The repository name

    • The name of the current branch (will explain later)

Avertissement

The first commit is at the bottom, the latest one is at the top of the page.

  • In the file Explorer, check your local folder:

_images/folder.png
  • You can see:

    • The file from the repository: test.txt

    • A hidden folder named .git: do not delete it !

History

  • Click on the second commit from the botton

_images/second.png
  • Click on test.txt on the right to see the diff of this commit

_images/histo2.png
  • In red, the lines that have been removed

  • In green, the new lines

Staged files

  • Using the File Explorer, create a text file named « FirstCommit.txt » in the repository

  • Go back to the GitKraken window

    _images/staged.png
    • Unstaged files: modified or new files that Git has not yet “prepared” for a commit

    • Staged files: files you have selected to be included in the next commit

  • Click on the button: Stage All Changes to add FirstCommit.txt to the next commit

Commit

  • In the lower right of the page

    • Write « New commit » in the commit description

    • Click on the Green button Commit

    _images/newcommit.png
  • Commit has been performed

    • The commit named « new commit » is shown at the top of the page:

    _images/commit.png
    • FirstCommit.txt is now in the local repository

    _images/added.png

Push

  • On your web browser, parse the files of the current repository:

    _images/list2.png
    • Oups ! The new file FirstCommit.txt is missing

    • GitKraken and GitHub are two excellent tools! That can not be a bug…

Avertissement

You must remember that a commit is performed locally: on your local/private repository. At no point, the GitHub repository was informed of the commits you made locally. Commit are private.

  • Let’s have a look at the GitKraken interface:

    _images/ttt.png
    • Note that the local commit is represented by a computer icon, signifying that it resides only on your local machine.

    • The remote repository is represented by your GitHub avatar and points to the previous commit.

  • Click on the PUSH icon

    • Now, the computer icon and your GitHub avatar are on the same line, remote and local repo are synchronized

    _images/push.png
  • Update the web page of the remote repository:

    _images/browser.png

Pull

  • In the web page of the GitHub repository, select: Add File > Create New File

    • Name the file: FirstPull.txt

    • Perform a commit

    _images/firstpull.png
  • The GitKraken Interface shows that the remote repository is one step ahead of the local repository:

    _images/ahead.png
  • In your local folder, only two files are present:

    _images/aaa.png
  • Synchronize your local repo using the Pull button

    • The avatar icon and the computer icon now appear on the same line:

      _images/afterpull.png
    • The new file has been added to the local repository:

      _images/bbb.png

Git as a decentralized system

The local/remote mechanism in Git is rooted in the philosophy of a decentralized version control system. Each local Git repository is a full and autonomous repository able to sync with the main Git repository.

  • Robustness and autonomy: The local repository is independent of the remote. Users can commit, branch, or explore history offline, ensuring resilience and uninterrupted workflow.

  • Asynchronous collaboration: The remote acts as a shared reference point. Push and pull operations synchronize local copies, allowing contributors to work independently while periodically integrating each other’s changes.

  • Conflict management and traceability: By separating local (private) and remote (shared) spaces, Git postpones conflict resolution until synchronization. Each commit is validated locally, while the preserved history guarantees full traceability.

Branching and merging

One of Git’s most powerful advantage is the ease of creating a test or development branch from the main branch. This new branch lets you experiment freely: if the attempt fails, it’s not a problem — the latest commit on the main branch remains stable. You can simply delete this test branch. If the experiment succeeds, you merge it back into the main branch, producing a merge commit.

  • In the GitKraken UI, select the last commit.

  • Click on the Branch button to create a new branch et name it.

  • Move your mouse cursor on the name of the branch:

    _images/newbranch.png
    • You see two branches: main and the new one

    • Your local repository has switched to the new branch: notice the check mark.

At this step, the two branches are at the same position in the tree, because they are identical.

  • In your File explorer, open the folder of the repository and create a new file named branch.txt

    _images/branch.png
  • In GitKraken, add and commit this new file

  • Modify the content of this file and commit

  • And a second time

_images/branch2.png

As illustrated in the commit graph, the current branch MyBranch contains three additional commits not present in main. The local and remote versions of main branch are synchronized with each other but remain behind MyBranch. At this point, you have multiple

Now that the work on this branch has been successfully completed, we merge the main branch with our current working branch. Several strategies are possible. One option is to push your commits directly into main branch and resolve conflicts there. However, if you fail, it may introduce significant issues for other contributors. The main branch must remain clean and functional.

We will use a safer strategy: Merge and Commit. The latest changes from main branch are merged into the test branch, conflicts are resolved locally, and once successful, the result is committed back to main. The test branch has fulfilled its purpose and now only remains as part of the documentation history.

  • In the web page of the GitHub repository, select: Add File > Create New File

    • Name the file: NewFileMainBranch.txt

    • Perform a commit

    _images/main2.png
  • GitKraken has noticed that the main branch has a new commit:

    _images/twobranches.png
    • We can now see the two branches running in parallel in the graph

    • The local main branch is not up to date

We now explain how to perform a Merge and Commit in the interface.

  • In the graph, click and drag the last commit of the main branch into the last commit of MyBranch

    _images/drag.png
  • Select Merge main into MyBranch

    _images/merge.png
    • Notice that an automatic merge commit has been created in MyBranch

  • Open the local folder of your repository

    _images/merge.png
    • The file NewFileMainBranch has been imported from the main branch and merged/commit into your branch

We do not have any conflict to handle, so we merge our branch into the main branch

  • Double-click on the Main branch in the graph to make this branch the current working branch

    _images/switch.png
  • Right click on MyBranch and select merge MyBranch into main

    _images/into.png

The new commits from the main branch were merged into MyBranch and then finalized back into the main branch.

  • Perform new commits in the main branch by adding some files

    _images/last.png

At this point, MyBranch has been retired, and further development proceeds on the main branch

Work to be done

By sharing the repository with a teammate, try to reproduce this graph by applying the appropriate operation:

_images/final.png