Skip to content

Commit 255bdf6

Browse files
authored
Merge pull request #14 from Anas-Rehberlik/main
Added Git and Github cheatsheet
2 parents a88b78e + d3e09bb commit 255bdf6

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

CheatSheets/Git-Cheatsheet.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Git CheatSheet
2+
3+
4+
| Command | Explanation |
5+
| ---------------------------------------------------------| -------------------------------------------------- |
6+
| `git config` | Configure Git settings. |
7+
| `git config --global user.name "Your Name"` | Set your name for Git. |
8+
| `git config --global user.email "youremail@example.com"` | Set your email for Git. |
9+
| `git config --global color.ui true` | Enable color output. |
10+
| `git init` | Initialize a new Git repository. |
11+
| `git clone <repository url>` | Clone an existing repository to your local machine.|
12+
| `git status` | Show the status of your working directory and staging area.|
13+
| `git add <file>` | Add a file to the staging area. |
14+
| `git commit -m "Commit message"` | Commit changes in the staging area with a message. |
15+
| `git branch` | Show a list of all branches in the repository. |
16+
| `git branch <branch name>` | Create a new branch with the given name. |
17+
| `git checkout <branch name>` | Switch to the branch with the given name. |
18+
| `git merge <branch name>` | Merge changes from the specified branch into the current branch.|
19+
| `git remote -v` | Show a list of all remote repositories. |
20+
| `git remote add <remote name> <remote url>` | Add a new remote repository. |
21+
| `git push <remote name> <branch name>` | Push changes to the remote repository. |
22+
| `git pull <remote name> <branch name>` | Pull changes from the remote repository. |
23+
| `git log` | Show a log of all commits in the repository. |
24+
| `git diff` | Show a diff of all changes made since the last commit.|
25+
| `git stash` | Temporarily save changes without committing them. |
26+
| `git reset` | Unstage changes in the staging area. |
27+
| `git revert <commit hash>` | Undo changes made in a specific commit. |
28+
| ---------------------------------------------------------| --------------------------------------------------- |
29+
30+
# Learn More about Github from here:
31+
32+
https://youtu.be/ng_3YZHnz8U

CheatSheets/GitHub-Cheatsheet.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# GitHub CheatSheet
2+
3+
# **How to Contribute to an Open Source Project**
4+
5+
🎉 Congratulations on deciding to contribute to an open source project! Here are the steps you can follow:
6+
7+
## **Step 1: Find a Project**
8+
9+
There are many open source projects out there that you can contribute to. Look for a project that interests you and is relevant to your skills.
10+
11+
## **Step 2: Fork the Repository**
12+
13+
To get started, fork the repository of the project you want to contribute to. This will create a copy of the project in your own GitHub account.
14+
15+
## **Step 3: Clone the Repository**
16+
17+
Next, clone the repository to your local machine using the **`git clone`** command and the URL of your forked repository.
18+
19+
## **Step 4: Set Up Remotes**
20+
21+
Set up a remote connection to the original repository using the **`git remote add`** command. This will allow you to keep your forked repository in sync with the original repository.
22+
23+
## **Step 5: Create a New Branch**
24+
25+
Create a new branch for your changes using the **`git checkout`** command and the **`-b`** flag.
26+
27+
## **Step 6: Make Changes**
28+
29+
Make the desired changes to the code base on your local machine.
30+
31+
## **Step 7: Track Changes**
32+
33+
Track the changes you made using the **`git add`** command.
34+
35+
## **Step 8: Commit Changes**
36+
37+
Commit your changes to your branch using the **`git commit`** command and an appropriate commit message.
38+
39+
## **Step 9: Push Changes**
40+
41+
Push your changes to your forked repository on GitHub using the **`git push`** command.
42+
43+
## **Step 10: Create a Pull Request**
44+
45+
Create a pull request (PR) from your branch to the original repository. Make sure to include a clear and detailed description of the changes you made in the PR.
46+
47+
## **Step 11: Wait for Review**
48+
49+
Wait for the maintainers of the project to review your PR. They may ask for changes or request additional information before accepting your contribution.
50+
51+
## **Step 12: Celebrate!**
52+
53+
Congratulations! You have made a valuable contribution to an open source project.
54+
55+
Remember, contributing to open source is a collaborative effort, and it's important to follow the guidelines and best practices of the project you are contributing to. Happy contributing! 🎉👏
56+
57+
58+
# Learn More about Git from here:
59+
60+
https://youtu.be/ng_3YZHnz8U

0 commit comments

Comments
 (0)