Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
09976f9
Added first section of how to start a new repository locally
neeschilling May 3, 2026
bdc71fe
Added section on connecting local repository to Github
neeschilling May 3, 2026
f04dca6
added empty commands file
neeschilling May 3, 2026
a272d58
added gitignore file
neeschilling May 3, 2026
0dca594
added licensing file
neeschilling May 3, 2026
ee8d605
added LICENSE file
neeschilling May 3, 2026
2af0361
Delete Licensing.md
neeschilling May 3, 2026
e5cd805
added MIT license
neeschilling May 3, 2026
21662a3
added folders and moved commands to documentation
neeschilling May 3, 2026
6c7a55f
Delete commands.md
neeschilling May 3, 2026
51baf0d
Merge branch 'main' into nesch_branch
neeschilling May 3, 2026
a591a32
Overwrite empty commands file in documentation
neeschilling May 3, 2026
3784218
Delete commands.md
neeschilling May 3, 2026
30ef7af
Added section on ssh key for new computers and how to configurate new…
neeschilling May 4, 2026
4068168
Added Git status and recover to previous state section
neeschilling May 4, 2026
955cfe8
added alternative history and Tagging
neeschilling May 4, 2026
0529d8e
added something unnecessary to tryout revert
neeschilling May 4, 2026
f7cdddf
Revert "added something unnecessary to tryout revert"
neeschilling May 4, 2026
d31eaec
Ignore personal project log file via .gitignore
carolienv May 9, 2026
febec52
Add a basic explanation of Git and GitHub
carolienv May 9, 2026
6fbfd02
Add git cheat sheet image
carolienv May 9, 2026
cfb319e
Add Git cheat sheet to documentation, referencing the source
carolienv May 9, 2026
4464d2f
Add a template to document example conflicts and how to resolve them
carolienv May 9, 2026
cb3a714
Add Git repository initialization command
carolienv May 9, 2026
4ec7066
Revert "Add Git repository initialization command"
carolienv May 9, 2026
50b528b
Explain concepts like branching, tagging, commit messages, ...
carolienv May 11, 2026
578b76e
Added a potential conflict
neeschilling May 11, 2026
37a4556
Merge branch 'merge_branch' into merge_branch_2
neeschilling May 11, 2026
ec262d1
Deleted unnecessary text in commit messages title
carolienv May 11, 2026
87b9b85
Added conflict
neeschilling May 11, 2026
420dec2
Explain why commit messages can be helpful
carolienv May 11, 2026
2e52683
Solved conflict, removed Neeltjes text
carolienv May 11, 2026
d9a5a5d
added conflict
neeschilling May 11, 2026
f423dec
Resolved conflict
neeschilling May 11, 2026
752daa2
added git stash
neeschilling May 11, 2026
a88424f
add psuh conflict, why this happens and how to resolve it
carolienv May 11, 2026
01efc2c
Both of us made changes on the branch so these changes need to be merged
carolienv May 11, 2026
ac90d57
Explain how to modify your most recent commit without creating a new one
carolienv May 11, 2026
04cca1d
extra tip on how to solve any conflict
carolienv May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
my_projectlog.md
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2026] [nesch]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions docs/cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Git cheat sheet

Below is a Git cheat sheet with commonly used Git commands.

![Git cheat sheet](../images/git_cheatsheet.png)

## Source

The cheat sheet image was obtained from https://raw.githubusercontent.com/hbons/git-cheat-sheet/master/preview.png
135 changes: 135 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Commonly used commands in git and GitHub

## Adding a ssh key for a new computer you wanna use Github on

1. Create a new ssh key for the new computer

`ssh-keygen -t ed25519 -C "your_email@example.com"`

2. copy the public ssh key to clipboard

3. Paste it into the ssh key section on Github

## Configurate git in new repository

1. Give username

`git config --global user.name "Your Name"`

2. Give E-mail adress

`git config --global user.email "email"`

## When you start a new repository locally

1. Make a folder where the project will be stored

2. In the commandline go to the folder

`cd <folder_adress>`

3. Initialize git

`git init`

4. Save your first file into the folder

5. Add file to repository

`git add <filename>`

6. Commit together with a meaningful message

`git commit -m <meaningful_message>`

## Connecting your local repositroy to GitHub for the first time

1. Add the repository to you GitHub account using a ssh adress

`git remote add origin <ssh_address>`

If you accidentally added a wrong address, you can remove with this command

`git remote remove origin`

2. Set the name of the main branch

`git branch -M <main_branch_name>`

3. Push your changes to GitHub while setting upstream

`git push --set-upstream origin <main_branch_name>`

## Check git status

Shows branch you are in and potential untracked changes

`git status`

Shows history of all changes together with ID

`git log`

Compare commits

`git diff`

`git show`

## Recover to a previous state

Recover to a previous state: Removes changes (means also deleting IDs so you can no longer access)

`git reset`

Reverts to previous state: Adds revert as a new head which means all changes are still tracked

`git revert`

Rewrite last commit message

`git commit -amend`

Go to a specific ID (!Warning tracks will not be saved unless you attach the new branch to main)

`git checkout <commit_ID>`

Attach branch

`git switch -c <new_branch_name>`

## Alternative history

Make new branch

`git branch <branch_name>`

Go to specific branch

`git checkout <branch_name>`

Merge branches

`git merge <target_branch_name>`

Remove branch

`git branch -d <branch_name>`

## Tagging

To highlight good versions

`git tag <name>`

`git push --tags`

## Other git commands

Save temporarily uncommitted changes without creating a commit

`git stash`

Modify you most recent commit without creating a new one (used to fix commit message, remove unwanted files or add forgotten files)

`git commit --amend`
50 changes: 50 additions & 0 deletions docs/concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Git concepts

Git is a version control software to track changes in files over times which runs **locally** in contrast with github which is an **online** platform to store (backup) your Git repositories. This will allow you to easily share and collaborate with others.

## Conceptual areas

1. Developing area: directory where the project is developed.
2. Staging area: in this space we organise files before a commit e.g. we want to commit file A and B together because they are related so we will put them both in the staging area.
3. Local repository: this is .git file where the git software manages all the versions that are committed.

## Commit messages

Adding a commit message is obligated, without it you cannot commit. Good commit messages will help you trace back what changed more easily.

Be as descriptive as you can. You can use the following questions to write a meaningful message:

- Why was it changed?
- How does this address the issue?
- Are there any effects due the change?
- Are there any limitations of the change?

## From local to remote

- SSH key: A way to securely connect to a remote computer/location/server. We add it to github in the settings for ssh key.
- How to create an empty remote repository on github: add a new repository on github, give it a nice name, don't add any files and follow the instructions to connect with the local
- Before we can backup our local repository we need to connect it to the remote repository. This is done by adding the origin of the remote repository by using remote add origin. Setting up this connections (bridge) between both is only done once.
- I should always synchronise the changes. Git push will send changes to my collaborators and the remote repository while git pull will send the changes from my collaborators or online changes to to my local repository.

## README file

This is a detailed description of the project, usage and installation. If it is named like this, it will automatically be the first page the user sees.

## .gitignore file
A list of files that should be ignored. Usually this is data, backups, intermediate files and confidential files. You can also use regex to ignore files that contain the certain pattern. If you put .gitignore itself in the file, this will also be ignored.

## Branching & checkout

To experiment risk free we can use branches. A new branch will have an independent timeline. It could be useful for debugging and testing especially when collaborating. You can move between the branches by using git checkout.
TIP: put the initial of the person who's working the branch in the name.

### Mirror effect
When using multiple branches, your environment becomes dynamic.

## Tagging
This is a way to highlight good versions (states/commits). It doesn’t matter in which branch. This way you don’t need to remember the commit id, but you can just give it a name. This is used e.g. for:
- A good version
- A version for a release
- A specific feature
- Experiment risk free
- ...
25 changes: 25 additions & 0 deletions examples/example_conflicts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Examples of conflicts
Document examples of conflicts and their resolution here.

*Hint: git usually tells you what needs to be done when an issue arises. Make sure to read the output in the terminal and follow the steps suggested.*

## Example 1

### Conflict situation
I am trying to push some changes to the remote repository but I get an error:

```
$ git push
To https://github.com/neeschilling/project_github_microcredential.git
! [rejected] merge_branch_2 -> merge_branch_2 (fetch first)
error: failed to push some refs to 'https://github.com/neeschilling/project_github_microcredential.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
```

### Conflict resolution
Because we were both working on the same file, the person trying to push last will get an error. You first need to check which changes were made by both and which to keep. This can be done with the command `git config pull.rebase false` after which you peform `git pull`.
This will now open the file involved in editing mode you can see the conflicting changes, decide what to keep and what not (or keep everything) after which you can add, commit and push the final changes.
Binary file added images/git_cheatsheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.