Skip to content

Submission of Microcredential Github project #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9f0b591
creation of the folder structure for Markdown concepts
saradufour Mar 20, 2025
b2633cf
Initiate folder structure for git and github concepts. Adding leena b…
leenput Mar 20, 2025
27bb697
Merge branch 'main' of github.com:saradufour/project_github_microcred…
saradufour Mar 20, 2025
34bfa2f
adding a .gitignore file to the repository
saradufour Mar 20, 2025
d359173
Added a general license.md file
leenput Mar 20, 2025
e96e36a
adding header, bold and italic featues in markdown tet to the cheat s…
saradufour Mar 20, 2025
4fd804d
Revert "adding header, bold and italic featues in markdown tet to the…
saradufour Mar 20, 2025
4786210
Revert "Revert "adding header, bold and italic featues in markdown te…
saradufour Mar 20, 2025
364e6d4
Update git_concepts.md with general concepts and information on conce…
leenput Mar 21, 2025
a7a5ef8
Updated git_concepts.md file with section on collaborations on git & …
leenput Mar 23, 2025
d7ab94d
Updated git_concepts.md file with information on branches
leenput Mar 23, 2025
972d195
Updated git_concepts.md file with .gitignore concept and how to keep …
leenput Mar 24, 2025
9598a1e
After git reset and some confusion, updated git_concepts.md with git …
leenput Mar 24, 2025
60e333a
markdown format corrections and typo fixes on git_concepts.md before …
Mar 25, 2025
a24f27c
minor text style fixes to git_concepts.md for readability
rabuono Mar 25, 2025
6384fdf
Revert "markdown format corrections and typo fixes on git_concepts.md…
rabuono Mar 25, 2025
4ddc8a7
format and typo fixes and addition of GitHub information in git_conce…
rabuono Mar 25, 2025
8c35670
reformat and expand tag concept in git_concepts.md
rabuono Mar 25, 2025
2927525
add GitHub release information in git_concepts.md
rabuono Mar 25, 2025
55c67a2
add clarification on pull requests in git_concepts.md
rabuono Mar 25, 2025
37f6519
add git fetch and clarify git push in git_concepts.md
rabuono Mar 25, 2025
79d599f
add a few initial git commands to git_cheat_sheet.md
rabuono Mar 25, 2025
e3df60f
typo fixes and add relative link to git concepts file in git_cheat_sh…
rabuono Mar 25, 2025
4021e6c
clarification and format fixes of GIT WORKFLOW in git_concepts.md
rabuono Mar 25, 2025
3d4e221
add note on the use of pull requests to merge branches in collaborati…
rabuono Mar 25, 2025
cea8692
Merge pull request #3 from saradufour/rafael
leenput Mar 25, 2025
0e38b6f
adding information to the markdown sheat cheet about ordered and unor…
saradufour Mar 25, 2025
32aec53
updating markdown sheat cheet with inserting links, documents and images
saradufour Mar 25, 2025
161214a
Updated and structured the git_cheat_sheet.md file with config and gi…
leenput Mar 27, 2025
c6d2666
Included a reference.md file to provide an overview of useful weblink…
leenput Mar 27, 2025
45230a8
Creating a test_revert.md file to test git revert command
leenput Mar 27, 2025
d836c2e
Revert "Creating a test_revert.md file to test git revert command"
leenput Mar 27, 2025
7978b71
Updated references.md, git_cheat_sheet.md with information on branche…
leenput Mar 27, 2025
d342b13
Revert "updating markdown sheat cheet with inserting links, documents…
saradufour Mar 27, 2025
b6a9809
Merging leena branch into main, resolving conflict on git_concepts.md…
leenput Mar 27, 2025
be19bb6
updating markdown_sheat-cheet with correct information on links and i…
saradufour Mar 27, 2025
529ecb8
start references file and add two references
rabuono Mar 27, 2025
eeaf148
adding collaboration strategy to the README.md
saradufour Mar 27, 2025
faf8f3b
Merge branch 'main' of github.com:saradufour/project_github_microcred…
saradufour Mar 27, 2025
7a75483
Merge branch 'sara' into main, inforamtion about Markdown will be add…
saradufour Mar 27, 2025
b277538
adding markdown reference
saradufour Mar 27, 2025
c50e20b
adding markdown reference, forced to create conflict with sara_confli…
saradufour Mar 27, 2025
d8f825c
solved conflict from merge main and sara_conflict branch
saradufour Mar 27, 2025
4044351
fixed typo in reference.md
saradufour Mar 27, 2025
8d03fd3
solving conflict with main branch and adding more reference links to …
rabuono Mar 28, 2025
5f97d4e
adding a new link to meet review requirements
rabuono Mar 28, 2025
7ccf111
Removed double reference from references.md file
leenput Mar 28, 2025
83c7f3b
Merge pull request #5 from saradufour/rafael_for_conflict
saradufour Mar 28, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#the files listed below can be ignored
Github_UsernameSara.png
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2025 GitHub, Inc.

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.
37 changes: 37 additions & 0 deletions Markdown-concepts/Markdown_Sheat-cheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Markdown cheat sheet

# Header 1
`use # HEADER`
## Header 2
`use ## HEADER`
### Header 3
`use ### HEADER`


**Bold text** (place text in between `** TEXT **`)

**Italic text** (place text in between `* TEXT *` or `_ TEXT _`)

## lists

### ordered lists
1. first list item
2. second list item
3. third list item


### Unordered lists
- A list item
- Another list item
- yet another list item


## links and images

### Links
[Visible URL](https://www.google.com)

### Images
![Alternative text when image is not there](../images/ImageInMarkdown.png)

`![Alternative text](pathToFile)`
5 changes: 5 additions & 0 deletions Markdown-concepts/Markdown_concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Markdown concepts

Markdown is a markup language used for adding formatting elements to a text document.

It is often used for web development, documentation, blogging, etc
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,10 @@ Once with the final version you must <span style="color:mediumBlue">make a pull
-------------------------------------------------------------------------------------------------

This project is part the first evaluation of the micro-credetial that is offered by [VIB](https://vib.be/en#/) and [UGent](https://www.ugent.be/en) with the aim to improve data analysis reproducbility in science. A micro-credential is like a mini-diploma that you have followed a course and learnd a new skill that is valuable for your carrear. If you are interested to register you can find more detais in the [UGent registration page](https://studiekiezer.ugent.be/2025/micro-credential-reproducible-data-analysis-an-essential-capability-in-modern-science-en).


collaboration strategy:
1. every collaborator creates a separate branch (leena, rafael, sara, main)
2. Leena works on git concepts, Rafael on github concepts, Sara on Markdown concepts
3. We communicate via Teams to update each other on the process and conflict creation/resolving.
4. second meeting on Thursday 27th at 2PM
100 changes: 100 additions & 0 deletions git_and_github_concepts/git_cheat_sheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# This is a cheat sheet for git and github

## Setup
This commands are for configuring user information used across all local repositories:

`git config --global user.name "[firstname lastname]"`: set a name that is identifiable for credit when review version history

`git config --global user.email "[valid-email]"`: set an email adress that will be associated with each history marker

`git config --global color.ui auto`: set automatic command line coloring for git for easy reviewing.

## Git setup & init
Commands to config user information, initialization and cloning repositories.

`git init`: to initialize an existing directory as a Git repository.

`git clone [url]`: retrieve an entire remote repository via URL

## Stage and snapshot
These are common commands used for working with snapshots and the Git staging area:

`git status`: to show current status. Use it to show modified files in the working directory, staged for your next commit.

`git add`: to add files to the staging area. See usage details for staging area in the [git concepts](/git_and_github_concepts/git_concepts.md) file.

`git reset [file]`: unstage a file while retaining the changes in your working directory

`git commit -m "meaningful message"`: to commit files from the staging area.

## Branch and merge
Commands to isolate work in branches, change context and integrate changes

`git branch <branch_name>`: create a new branch at the current commit

`git checkout <branch_name>`: switch to another branch

`git merge <branch_name>`: merge the specified branch's history into the current one.

## Inspect and compare
Commands to examine logs, diffs and object information

`git log`: to see the log of all commits (for the currently active branch). Can be used with `-n #` where `#` is the number of commits in the past to show. `--abbrev-commits` will provide the abbreviated SHA for the commits.

`git log branchA..branchB`: show the commits on branchA that are not on branchB.

`git log --follow [file]`: show the commits that changed the specified file, even across renames

`git diff`: to show the difference between changes in your working directory and staged area.

`git diff --staged`: to show differences between staging area in all local files and the repository. If you add a filename, you will only see the staged changes in a certain file. Alternative: `git diff --cached`

`git diff <commit1> <commit2>`: to show differences between commits. Where <commit1> and <commit2> are the SHA of the commits to be compared. First will be compared to second.

`git diff <branch1> <branch2>`: show differences between two branches.

`git show [SHA]`: show any object in Git in human-readable format.

## Tracking path changes
Commands to version file removes and path changes

`git rm [file]`: delete the file from project and stage the removal of the commit

`git mv [existing-path] [new-path]`: change an existing file path and stage the move

`git log --stat -M`: show all commit logs with indication of any paths that were moved.

## Redo commits
Commands to erase mistakes and craft replacement history

`git revert [commit SHA]`: create a new commit, reverting changes from the specified commit. It generates an inversion of changes (safest option)

------ more dangerous option:

`git reset [commit]`: Undoes all commits after [commit], preserving changes locally. It switches the current branch to the target commit, leaving a difference as an uncommited change.

`git reset --hard [commit]`: Discards all history and changes back to the specified command.

**CAUTION**: changing history can have nasty side effects. If you need to change commits that exist on GitHub, proceed with caution.


## Share and update
Commands to retrieve updates from another repository and updating local repository

`git remove add [alias] [url]`: add a git URL as an alias

`git fetch [alias]`: fetch down all the branches from that Git remote. It downloads all history from the remote tracking branches.

`git merge [alias]/[branch]`: merge a remote branch into your current local branch to bring it up to date.

`git push [alias] [branch]`: transmit local branch commits to the remote repository branch.

`git pull`: Updates your current local working branch with all new commits from the corresponding remote branch on GitHub. It is a combination of git fetch and git merge.

## Tagging commits

`git tag`: list all tags

`git tag [name] [commit SHA]`: create a tag reference named 'name' for current commit. Add commit SHA to tag a specific commit instead of current one.

`git tag -d [name]`: remove a tag from local repository.
112 changes: 112 additions & 0 deletions git_and_github_concepts/git_concepts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# GIT AND GITHUB CONCEPTS

## What is Git and Github?
**Git:**
Git is a software to create a timeline of your projects. It keeps track of all changes you make during your project development and allows you to go back to each version at any point in time. You can save changes, and once you commit them to a version that is a snapshot in time.

**GitHub:**
Online repository to collect different git projects. GitHub can be used as an online backup of all your timelines that were created in git. As a web-based platform, GitHub offers several features that extend beyond the basic functionalities of git. These include:
- Repository Hosting: GitHub hosts Git repositories online, making them accessible from anywhere.
- Pull Requests: This feature allows developers to propose changes to a codebase, review code, and discuss modifications before merging.
- Issues and Bug Tracking: GitHub provides a built-in issue tracker to manage bugs, feature requests, and other tasks.
- Project Management Tools: GitHub offers project boards, milestones, and other tools to help manage and organize development tasks.
- Code Reviews: GitHub facilitates code reviews with inline comments and discussions on pull requests.
- Actions and CI/CD: GitHub Actions allows you to automate workflows, including continuous integration and continuous deployment (CI/CD).

## How to start your timeline/repository?
**Start a local repository:**
When you are in your local project folder, you can start the timeline by initializing git, this will create a .git file. Git tracks every subfolder in your root folder, so no need to initialize it twice.
`git init`

**Start from a remote repository:**
1. On github, you can go to a remote repository, and clone it to your local machine. No need to initialize the timeline again.
`git clone ssh-address-repository`

2. You can also first 'fork' to create a personal copy of a repository on GitHub. It allows you to freely experiment with changes without affecting the original repository.

## Where is Git/GitHub? Three conceptual areas:
**1. Developing area**
My computer: developing area with local folder where project is developed.

**2. Preparation: staging area?**
If we do `git add`, we send it to the staging area, which is the place where you add files to prepare for commit. Location to prepare new snapshots to the timeline (before commit).

**3. Local repository: where is the timeline?**
The local repository on your computer is where all the versions live. It is the .git folder you have initialized. Typically only text files.

**4. Remote area (GitHub):**
It is the remote repository. In the context of this course, we use GitHub. You first need to make a repository in GitHub, then you can use the ssh address of the repository to make a bridge on your computer to the remote repository. After that, you can push your local repository to the remote one. Make sure to always clean up your working tree first (check with `git status`).

GIT WORKFLOW:
1. adjust your files and save (developing area)

2. once you are ready, you should do:
`git add file_A`: records the changes made to file_A and adds it to the staging area
`git add *`: records the changes made to all files and adds it to the staging area

3. commit changes:
`git commit -m "message"`: you send from staging area to local commit, linked to a meaningful message.

4. push changes to remote repository:
`git push`: send commit to remote area

5. retrieve remote changes locally:
`git pull`: get updates

## Collaborations:
**Adding collaborators:** You can grant other GitHub users access to your repository as collaborators, allowing them to push changes.

**Fetching changes:** Fetching changes from a remote repository downloads changes but does not apply them to your local branch.

**Pulling changes:** Pulling changes from a remote repository downloads and merges them to your local branch.

**Conflicts:** If you are working with someone simultaneously and somebody pushes it before you, this will create a conflict, because Git cannot automatically merge changes. When you try to push your modifications, you will get an error. You need to manually resolve conflicts by editing the conflicting files. For this, you first need to pull the latest version (containing the commit of your collaborator), then you can modify the file and look at the conflict closely and resolve. After that, you need to git add, commit and push it again.

**Pull requests:** A pull request is a way to propose changes to a repository and facilitate collaborations. While a request for a pull exists as a git concept, the formalized pull request is a feature of web-based git hosting services like GitHub. You create a pull request when you want to merge changes from one branch into another, and you need someone to review and approve them before merging.
1. Push your changes to GitHub
2. Open GitHub and navigate to your repository
3. Click the "Pull Requests" tab and create a new pull request, selecting your feature branch and the main branch
4. Once reviewed, the pull request can be merged.

GitHub provides extensive documentation on pull requests in their [GitHub Docs platform](https://docs.github.com/en/pull-requests).

## Tag a commit
Git allows to create tags to mark specific points in the timeline of your repository. Tags can be used to specify specific versions of the code in a project. They can also be used to denote significant milestones in the development process.
You can use `git tag <tag_name>` to add a tag to a commit in your timeline.
It is important to note that tags must be included in the push command. When you push, you need to add `<tag_name>`to push a specific tag or `--tags` to push all tags.
To remove a tag, use `git tag -d <tag_name>` to delete a specific tag, but you also need to delete it manually on github.

**A note on releases:** Releases are a GitHub feature. They work on top of the tags feature and provide a way of packaging and distributing specific versions of the project. In addition to including release notes, releases can also have downloadable assets, like software source code.

## Branches
A branch is an independent timeline that roots from the main timeline. You can use it to work independently on same project, to experiment without risk, etc.
`git branch <name>`: initiate a new branch

To move between branches you need to do git checkout.
`git checkout <branch_name>`: switches between branches.

Once you’ve completed work on a branch, you can merge it back into the main branch:
- first switch to the main branch: `git checkout main`
- merge your branch with main: `git merge <your_branch>`

Once merged, you can delete the branch:
`git branch -d <your_branch>`

**A note on direct merging and pull requests**
While you can directly merge a branch into your main branch, the commands described above do not include a review process. In collaborative projects that are hosted in web-platforms such as GitHub, the use of a pull request to bring code changes from a branch into the main branch of a project is advisable. Pull requests allow for collaborators to review and comment on changes, giving chance for useful feedback and code improvements.

## What is a .gitignore file?
In many cases, the project creates a lot of logs and other irrelevant files which are to be ignored. So to ignore those files, we have to put their names in“.gitignore” file.
The .gitignore file specifies files and directories that should be ignored by Git. It is used to prevent certain files from being tracked or committed.

## GitHub history and keeping track of commits
You can create an overview of what commits have been done in the entire history of your project. It shows you the commit hashes (IDs), the author and date of the commit, and the message that was assigned to it. It is great for reviewing past changes or finding a specific commit.
`git log`: display commit history

You can keep track of what is going on in your working directory and staging area using git status.
`git status`: it shows you which files have been modified, which files are staged and which are untracked (new and not in git yet)

To compare different commits or files you can use git diff.
1. `git diff`: see unstaged changes (working directory vs last commit)
2. `git diff --cached` or `git diff --staged`: see staged changes (staging area vs last commit)
3. `git diff <commit1> <commit2>`: compare two commits
Binary file added images/ImageInMarkdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/git-diff-schematic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/github_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file gives an overview of the references used in this project.

## Git and Github concepts and cheat sheet:
- Training material: [VIB training_material](https://github.com/vibbits/introduction-github)
- [Medium git and github guide](https://medium.com/@ramadan123sayed/a-comprehensive-guide-to-git-and-github-from-beginner-to-advanced-with-practical-use-cases-8e1ad98b48db)
- [Git lab Cheat Sheet](https://about.gitlab.com/images/press/git-cheat-sheet.pdf)
- [GitHub documentation portal](https://docs.github.com/en)
- [Git cheat sheet from GitHub Education](https://education.github.com/git-cheat-sheet-education.pdf)
- [GitHub Education](https://github.com/education)

## Images:
- [git and github logo](https://pngimg.com/d/github_PNG65.png)
- [git diff schematic](https://lafkblogs.wordpress.com/2015/12/08/why-git-diff-shows-nothing/)

## Markdown
- [Markdown cheat sheet](https://www.markdownguide.org/cheat-sheet/)