Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

# git_test

This repository is for learning Git and GitHub in a simple way.

## What Git is

Git is a version control tool.

It helps track changes in files over time.

With Git, I can:

- see what changed

- save versions of my work

- go back to older versions

- work on different branches

- merge work together

## What GitHub is

GitHub is a website that stores Git repositories online.

It helps with:

- backing up repositories online

- sharing code

- 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

- creating files

- using git add

- using git commit

- using git push

- using git log

- reading commit hashes

- creating branches

- understanding why branches are important

- creating a feature branch

- creating a hotfix branch

- creating and resolving a merge conflict

- using .gitignore

- using README.md

- creating a Git tag

## Commits

A commit is a saved checkpoint in Git.

I made commits in this repo to save changes after:

- adding a notes file

- updating the README

- adding .gitignore

- editing files on branches

- resolving a merge conflict

- making a hotfix change

## Pushes

A push sends local commits from my machine to GitHub.

I used push to send my changes to the remote GitHub repo.

## Branches

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

- make hotfixes easier

## Branches I used

### main

This is the main branch.

It represents the main working version of the repo.

### feature/update-notes

This was used to practise feature work on a separate branch.

### hotfix/readme-update

This was used to practise a hotfix branch.

A hotfix branch is for urgent fixes.

## Merge conflicts

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.

I resolved it by:

1. opening the file

2. checking the conflict markers

3. choosing the final content I wanted

4. removing the markers

5. saving the file

6. adding and committing the resolved file

## Tags

A tag marks an important commit.

I created this tag:

- v1.0.0

This tag marks a version of the repository.

## Releases

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

.gitignore tells Git which files and folders should not be tracked.

I added .gitignore to ignore common local files such as:

- \_\_pycache\_\_/

- .venv/

- \*.log

- .env

This is important because some files should stay local and should not be committed.

## Markdown files

.md files are Markdown files.

They are used to document repositories in a simple readable format.

The most common one is:

- README.md

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.

## Summary

This repository helped me practise the basic Git workflow:

- clone

- add

- commit

- push

- branch

- merge

- resolve conflicts

- use tags

- use .gitignore

- use Markdown documentation

Hotfix workflow completed through branch, PR, merge, and delete.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors