This repository is for learning Git and GitHub in a simple way.
Git is a version control tool.
It helps track changes in files over time.
- save versions of my work
- go back to older versions
- work on different branches
GitHub is a website that stores Git repositories online.
- backing up repositories online
- working with other people
- pushing and pulling changes
## What I practised in this repo
In this repo I practised:
- cloning a repo from GitHub to my machine
- understanding why branches are important
- creating a feature branch
- creating a hotfix branch
- creating and resolving a merge conflict
A commit is a saved checkpoint in Git.
I made commits in this repo to save changes after:
- editing files on branches
- resolving a merge conflict
A push sends local commits from my machine to GitHub.
I used push to send my changes to the remote GitHub repo.
A branch is a separate line of work.
Branches are important because they:
- keep the main branch stable
- allow work on new changes safely
- help teams work on different tasks at the same time
It represents the main working version of the repo.
This was used to practise feature work on a separate branch.
This was used to practise a hotfix branch.
A hotfix branch is for urgent fixes.
A merge conflict happens when two branches change the same part of a file and Git cannot decide which version to keep automatically.
I created a merge conflict on purpose in notes.txt.
2. checking the conflict markers
3. choosing the final content I wanted
6. adding and committing the resolved file
A tag marks an important commit.
This tag marks a version of the repository.
A release is usually created on GitHub from a tag.
A tag marks the version in Git.
A release gives that version a title and notes on GitHub.
.gitignore tells Git which files and folders should not be tracked.
I added .gitignore to ignore common local files such as:
This is important because some files should stay local and should not be committed.
.md files are Markdown files.
They are used to document repositories in a simple readable format.
This file explains what the repository is for and what was done in it.
## git log and commit hashes
git log shows the history of commits.
Each commit has a unique commit hash.
A commit hash helps identify a specific saved change in the repo.
This repository helped me practise the basic Git workflow:
- use Markdown documentation
Hotfix workflow completed through branch, PR, merge, and delete.