https://github.com/learnwithfair/github-documentation
github-documentation [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]
https://github.com/learnwithfair/github-documentation
documentation git github github-documentation-generator learn-with-fair learnwithfair rahatul-rabbi rahatulrabbi
Last synced: 7 months ago
JSON representation
github-documentation [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]
- Host: GitHub
- URL: https://github.com/learnwithfair/github-documentation
- Owner: learnwithfair
- Created: 2024-04-30T17:37:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T05:06:26.000Z (12 months ago)
- Last Synced: 2025-05-13T00:47:05.622Z (9 months ago)
- Topics: documentation, git, github, github-documentation-generator, learn-with-fair, learnwithfair, rahatul-rabbi, rahatulrabbi
- Language: HTML
- Homepage:
- Size: 2.78 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Youtube][youtube-shield]][youtube-url]
[![Facebook][facebook-shield]][facebook-url]
[![Instagram][instagram-shield]][instagram-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
Thanks for visiting my GitHub account!
# Git & GitHub DOCUMENTATION
> **GitHub** is a developer platform that allows developers to create, store, manage and share their code. It uses Git software, providing the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project. [more](https://www.w3schools.com/css/)
### [Code-Example](https://github.com/learnwithfair/github)
## Source Code (Download)
[Click Here](https://mega.nz/folder/RGFiUApD#PoKIVCwF8IkQhE2PHw1XxQ)
## Required Software (Download)
- Git, Download ->https://git-scm.com/download/win
## Project Overview
| |
| :-----------------------------------: |
| Git & Github |
|  |
1. git?
- git is a version control software
- It keep track of code changes
- It helps to collaborate in a project
- It is installed and maintained locally
- It provides Command Line Interface (CLI)
- Released in April 7, 2005
- Developed by Linus Torvalds & Junio C Hamano
2. github?
- GitHub is a hosting service where we can keep our git repositiory/folders
- It is maintained on cloud/web
- It provides Graphical User Interface (GUI)
- Founded in 2008
## One Step Back
```bash
cd ../
```
## Repository Upload Command
```bash
โฆor create a new repository on the command line
echo "# Laravel-restaurant" >> README.md
git init
git config --global --add safe.directory 'E:/Programming File/Cpp (++) Programming' (Optional)
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/learnwithfair/laravel-restaurant.git
git push -u origin main
โฆor push an existing repository from the command line
git remote add origin https://github.com/learnwithfair/laravel-restaurant.git
git branch -M main
git push -u origin main
### If fetch any error then try as-
git branch --set-upstream-to=origin/main main
git pull origin main --allow-unrelated-histories
git push -u origin main
##########
to check brance -> git brance -a
Change Brance git checkout branceName
more details -> git cheat sheet
```
## Option A
# ๐ ๏ธ GitHub CLI Setup Guide for Windows 11
This guide explains how to install, configure, and use the GitHub CLI (`gh`) on Windows 11, including authentication and cloning private repositories.
---
## โ
1. What is GitHub CLI?
The GitHub CLI (`gh`) lets you use GitHub features like:
- Cloning repositories
- Creating issues and pull requests
- Authenticating with GitHub
- Managing your projects
It works directly from the command line or terminal inside VS Code.
---
## โ
2. Install GitHub CLI on Windows 11
### ๐น Step 1: Download the Installer
- Visit: [https://cli.github.com/](https://cli.github.com/)
- Click on **Windows** to download the `.msi` installer.
Direct link: https://github.com/cli/cli/releases/latest
### ๐น Step 2: Run the Installer
- Open the downloaded `.msi` file.
- Proceed with **default settings**.
- Finish installation.
---
## โ
3. Verify Installation
Open **Command Prompt** or **VS Code Terminal** and run:
```bash
gh --version
```
You should see something like:
```bash
gh version 2.50.0 (2025-05-22)
```
---
## โ
4. Authenticate with GitHub
Run the login command:
```bash
gh auth login
```
Youโll be prompted to:
- Choose GitHub.com
- Choose `HTTPS`
- Authenticate in browser
Follow the instructions โ copy the URL โ paste into browser โ login with GitHub โ authorize the CLI.
If successful, youโll see:
```bash
โ Logged in as learnwithfair
```
---
## โ
5. Clone a GitHub Repo
You can now clone any public or private repository (if you have access):
```bash
gh repo clone learnwithfair/Carento-customization
```
---
## โ
6. List Your Repositories
```bash
gh repo list
```
Example output:
```bash
learnwithfair/awesome-project Public
learnwithfair/top-secret-project Private
```
---
## โ
7. More Useful Commands
| Command | Description |
|--------------------|--------------------------------------------|
| `gh repo view` | View current repo info |
| `gh repo fork` | Fork a repository |
| `gh pr create` | Create a new pull request |
| `gh issue list` | List all issues in the current repo |
| `gh repo create` | Create a new GitHub repo from the CLI |
| `gh auth logout` | Logout from GitHub |
---
## ๐ง Tip
If you're a **collaborator on a private repo**, `gh` is the easiest way to clone and work with it โ no need to handle tokens or SSH manually.
---
## โ
Uninstalling (Optional)
To uninstall:
- Open **Control Panel โ Programs โ Uninstall a Program**
- Select **GitHub CLI** and click Uninstall
---
## ๐ Done!
You're now ready to manage GitHub from your terminal like a pro ๐
## Option B
### [Lesson 3. How to set git environment and configuration](https://youtu.be/vj5-nkhTRbo)
- create a GitHub account
- [setup ssh](https://youtu.be/ykLd4YQMzCo?si=hS4bShi16XfD4n5y) :
- type in terminal `for generating SSH Key: ssh-keygen -t ed25519 -C "your email goes here"`
- type in terminal `cat ~/.ssh/id_ed255519.pub`
- copy the ssh and add to github
- Download and install git on your pc: https://git-scm.com/
- check git version: open terminal or cmd then use the command `git --version` to find out whether git is installed or not. if git is installed it will return a version number of git.
### git configuration
1. check all configuartion options: `git config`
2. set global user name and user email for all repository/git folders (if you want to set different username and email for different git repository then remove --global)
- set global user name: `git config --global user.name "anisul-islam"`
- set global user email: `git config --global user.email "anisul2010s@yahoo.co.uk"`
3. list all git configuration:
- list all the configuration: `git config --list`
- list user name: `git config user.name`
- list user email: `git config user.email`
4. change global username & email
- change global user name: `git config --global user.name "PUT_NEW_USER_NAME_HERE"`
- change global user email: `git config --global user.email "PUT_NEW_USER_EMAIL_HERE"`
### [Lesson 4. creating git repo and adding new files](https://youtu.be/oa6viOCTEeM)
1. creating a git folder
- ls -a : list all files inside of a directory
```
mkdir DIRECTORY_NAME_HERE
cd DIRECTORY_NAME_HERE
git init
Example:
mkdir notes
cd notes
git init
ls -a
```
2. adding new files in git folder
- git status : displays the state of the working directory and staging area
```
ls -a
touch fileName.extension
open fileName.extension
git status
Example:
touch day1.txt
open day1.txt
write something inside the file
```
- Git is aware of the file but not added to our git repo
- Files in git repo can have 2 states โ tracked (git knows and added to git repo), untracked (file in the working directory, but not added to the local repository)
- To make the file trackable stagging or adding is required
### [Lesson 5. how to add files in staging area & remove files](https://youtu.be/IDhgZX4esQQ)
1. adding files to stagging area:
- `git add fileName` add a file in staging area / index
- `git add .` add all files of directory to stagging area not subdirectory
- `git add -A` add all files of directory and subdirectory to stagging area
- `git rm --cached fileName` unstage a file from staging area
- `git diff` - checking the differences of a staged file
- `git restore fileName` - restore the file
### [Lesson 6. practice-1](https://youtu.be/jSj-GF-utls)
### [Lesson 7. commit & uncommit](https://youtu.be/gmBKbxKGcn8)
- `git commit -m "message"` move the file to local repository from stagging area
- `git log` check the commit history
- `git reset --soft HEAD^` uncommit the commit in HEAD and move to staging area
- `git reset HEAD^` uncommit the commit in HEAD and move to unstaging / working area
- `git reset --hard HEAD^` uncommit the commit in HEAD and delete the commit completely with all the changes

### [Lesson 8. git HEAD and undo theory](https://youtu.be/xUNsecljvog)
- `git log --oneline`
- `git show`
- `git show HEAD^`
- `git show commit-id`
- `git checkout commit-id`
- `git checkout master`
### [Lesson 9. git HEAD and undo practical](https://youtu.be/rEoeC-HBqws)
### [Lesson 10. git revert]()
### [Lesson 11. git ignore](https://youtu.be/CKla6oWTezM)
- create a .gitignore file and add the things you do not want to add in the stagging area
- Inside .gitignore we can keep secret files, hidden files, temporary files, log files
- `secret.txt` secret.txt will be ignored
- `*.txt` ignore all files with .txt extension
- `!main.txt` ignore all files with .txt extension without .main.txt
- `test?.txt` ignore all files like test1.txt test2.txt
- `temp/` all the files in temp folders will be ignored
### [Lesson 12. how to create github repository and commits](https://youtu.be/HRVNOjl9e5U)
- sign in to your github account
- create a git repo
### [Lesson 13. README.md](https://youtu.be/bl0-DTgh-mw)
[README video is here](https://youtu.be/bl0-DTgh-mw)
- Everything you need to know about README.md is discussed in the video.
- 6 heading levels: number of hashes define heading levels. check the following examples:
- `# heading 1 level text is here`
- `## heading 2 level text is here`
- bold syntax: `**text goes here**`
- italic syntax: `_text goes here_`
- bold and italic syntax: `**_text goes here_**`
- strikethrouh syntax: `~~this is~~`
- single line code syntax: `` place code inside backticks
- multiple line code syntax: ``` place code inside three open and closing backticks
- multiple line code syntax language specific: ```html for specific lanaguage use language name when starting; not closing
- Ordered List syntax
```
1. HTML
2. CSS
1. Fundamental
2. CSS Architecture - BEM
3. CSS Preprocessor - SASS
3. JS
```
- Unordered List syntax ->
```
- html
- css
- Fundamental
- CSS Architecture - BEM
- CSS Preprocessor - SASS
- js
```
- Task List
```
- [x] Task1
- [x] Task2
- [x] Task3
```
- adding link
```
http://www.studywithanis.com
[title](link)
[studywithanis](http://www.studywithanis.com)
[studywithanis][websitelink]
[websitelink]: http://www.studywithanis.com
```
- adding image syntax -> ``
``
- adding emoji
[emoji src](https://getemoji.com/) ### Smileys
๐ ๐ ๐ ๐ ๐ ๐
๐ ๐คฃ ๐ฅฒ โบ๏ธ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฅฐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐คช ๐คจ ๐ง ๐ค ๐ ๐ฅธ ๐คฉ ๐ฅณ ๐ ๐ ๐ ๐ ๐ ๐ ๐ โน๏ธ ๐ฃ ๐ ๐ซ ๐ฉ ๐ฅบ ๐ข ๐ญ ๐ค ๐ ๐ก ๐คฌ ๐คฏ ๐ณ ๐ฅต ๐ฅถ ๐ฑ ๐จ ๐ฐ ๐ฅ ๐ ๐ค ๐ค ๐คญ ๐คซ ๐คฅ ๐ถ ๐ ๐ ๐ฌ ๐ ๐ฏ ๐ฆ ๐ง ๐ฎ ๐ฒ ๐ฅฑ ๐ด ๐คค ๐ช ๐ต ๐ค ๐ฅด ๐คข ๐คฎ ๐คง ๐ท ๐ค ๐ค ๐ค ๐ค ๐ ๐ฟ ๐น ๐บ ๐คก ๐ฉ ๐ป ๐ โ ๏ธ ๐ฝ ๐พ ๐ค ๐ ๐บ ๐ธ ๐น ๐ป ๐ผ ๐ฝ ๐ ๐ฟ ๐พ
### Gestures and Body Parts
๐ ๐ค ๐ โ ๐ ๐ ๐ค ๐ค โ๏ธ ๐ค ๐ค ๐ค ๐ค ๐ ๐ ๐ ๐ ๐ โ๏ธ ๐ ๐ โ ๐ ๐ค ๐ค ๐ ๐ ๐ ๐คฒ ๐ค ๐ โ๏ธ ๐
๐คณ ๐ช ๐ฆพ ๐ฆต ๐ฆฟ ๐ฆถ ๐ฃ ๐ ๐ฆป ๐ ๐ซ ๐ซ ๐ง ๐ฆท ๐ฆด ๐ ๐ ๐
๐ ๐ ๐ฉธ
- adding table
```
table syntax
| heading1 | heading2 |
| ----- | ----- |
| data1 | data2 |
| data3 | data4 |
| data5 | data6 |
```
### [Lesson 14. Connecting local repo to remote repo](https://youtu.be/sLX2YWYpkAc)
- check remote connection: `git remote` or `git remote -v`
- `git remote add name ` example: git remote add origin http://...
- to clone a remote repository: `git clone `
### [Lesson 15. push and pull](https://youtu.be/UXEoCfYwI1Q)
- push a branch `git push -u origin branch_name`
- push all branches `git push --all`
- pull from a repo: `git pull` which is equivalent to git fetch + git merge
### [Lesson 16. branching and merging](https://youtu.be/3k8Bq_usPsk)
- Branch is a new and separate branch of the master/main repository, which allows you parallel development.
- Branching allows you to diverge from the main line of development and continue working on a separate line of code without affecting the main codebase. When you create a branch, you essentially create a copy of the code at a certain point in time, and you can make changes to this copy independently of other branches. Branches are often used for developing new features, fixing bugs, or experimenting with changes.
- Merging is the process of combining the changes from one branch (the source branch) into another (the target branch). This allows you to incorporate the changes made in one branch back into the main codebase or another branch. When you merge branches, Git automatically integrates the changes, resolving any conflicts that may arise if the same part of the code was modified in both branches.
- create a branch `git branch branch_name`
- List branches `git branch`
- List all remote branches `git branch -r`
- List all local & remote branches `git branch -a`
- move to a branch `git checkout branch_name`
- create and move to a branch `git checkout -b branch_name`
- delete a branch: `git branch -d branch_name`
- merge branches:
```
git checkout branchName
git merge branchName
```
- `git log --oneline --all --graph`
### [Lesson 17. branching and merging locally](https://youtu.be/AhBxGYzdWI0)
### [Lesson 18. git and GitHub practice - 2](https://youtu.be/IHVzseHh3Bo)
### [Lesson 19. GitHub Issues](https://youtu.be/E5HFlpx7QP4)
### [Lesson 20. 2-way and 3-way merges]()
- Reeference:
- https://www.tutorialspoint.com/what-is-a-fast-forward-merge-in-git
- https://www.tutorialspoint.com/what-is-3-way-merge-or-merge-commit-in-git
- https://medium.com/@koteswar.meesala/git-fast-forward-merge-vs-three-way-merge-8591434dd350
### [Lesson 21. Merge Conflicts]()
- https://www.tutorialspoint.com/what-is-merge-conflict-in-git-how-to-handle-merge-conflicts
### Lesson 22. Tags
In GitHub, "tags" typically refer to Git tags. Git tags are a way to mark specific points in a Git repository's history as being important or significant. They are often used to label specific commits, such as releases or version numbers, to make it easier to reference those commits in the future.
Here's how Git tags work:
1. **Creating a Tag:** You can create a Git tag by running a command like `git tag `, where `` is the name you want to give to the tag. For example, you might create a tag for a release like this: `git tag v1.0.0`.
2. **Tagging Commits:** Tags are typically associated with specific commits. When you create a tag, it's linked to the current commit, but you can also specify a different commit if needed.
3. **Listing Tags:** You can list all the tags in a Git repository using the `git tag` command.
4. **Annotated vs. Lightweight Tags:** Git supports two types of tags: annotated and lightweight. Annotated tags are recommended for most use cases because they store extra metadata like the tagger's name, email, date, and a tagging message. Lightweight tags are just a name for a specific commit and don't include extra information.
5. **Pushing Tags:** By default, when you push changes to a remote Git repository, tags are not automatically pushed. You need to use `git push --tags` to push tags to a remote repository. This is important when you want to share tags, especially when creating releases on GitHub.
6. **Using Tags on GitHub:** On GitHub, you'll often see tags associated with releases. When you create a release on GitHub, it typically creates a Git tag behind the scenes to mark the specific commit associated with that release. Users can then download or reference that release by its tag name.
GitHub also has its own concept of "releases" that are closely related to Git tags. A release on GitHub is a way to package and distribute software versions, and it often corresponds to a Git tag. When you create a GitHub release, you can upload release assets (e.g., binaries, documentation) and provide release notes.
In summary, GitHub tags are essentially Git tags, and they are used to mark important points in a repository's history, often associated with releases or significant commits. They help users easily reference and work with specific versions of a project.
### git revert
In Git, git revert is a command used to create a new commit that undoes the changes made by a previous commit. This command is helpful when you want to revert specific changes without altering the commit history.
## Follow Me
[
](https://github.com/learnwithfair) [
](https://www.facebook.com/learnwithfair/) [
](https://www.instagram.com/learnwithfair/) [
](https://www.twiter.com/learnwithfair/) [
](https://www.youtube.com/@learnwithfair)
[youtube-shield]: https://img.shields.io/badge/-Youtube-black.svg?style=flat-square&logo=youtube&color=555&logoColor=white
[youtube-url]: https://youtube.com/@learnwithfair
[facebook-shield]: https://img.shields.io/badge/-Facebook-black.svg?style=flat-square&logo=facebook&color=555&logoColor=white
[facebook-url]: https://facebook.com/learnwithfair
[instagram-shield]: https://img.shields.io/badge/-Instagram-black.svg?style=flat-square&logo=instagram&color=555&logoColor=white
[instagram-url]: https://instagram.com/learnwithfair
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://www.linkedin.com/in/rahatul-rabbi/