https://github.com/sanjarzayniev/git-demo
My Notes about GIT
https://github.com/sanjarzayniev/git-demo
git notes
Last synced: about 1 year ago
JSON representation
My Notes about GIT
- Host: GitHub
- URL: https://github.com/sanjarzayniev/git-demo
- Owner: sanjarzayniev
- Created: 2023-05-19T18:14:23.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-22T09:59:37.000Z (over 2 years ago)
- Last Synced: 2025-02-13T02:48:04.626Z (over 1 year ago)
- Topics: git, notes
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **My Notes**

## Generating SSH keys
```sh
ssh-keygen
# press enter, enter ...
```
> **NOTE:**
> `id_rsa` (private key), `ida_rsa.pub` (public key)
After this:
* Go to the github settings page.
* Navigate through **SSH and GPG keys** section.
* Click `Add new SSH key` (or like) button.
* Then paste contents of `ida_rsa.pub` file.
> **NOTE:**
> You can get it by `cat ~/.ssh/id_rsa.pub`
* Then save, and clone your repositories.
## Cloning git repo
```sh
git clone username/repository
# via SSH
git clone git@github.com:sanjarzayniev/git-demo.git
```
## Useful Git Commands
See what files added/modified and deleted.
```sh
git status
```
Add changes, e.g You created file named `main.cpp` and you wanna add it.
```sh
git add main.cpp
```
Or you made some changes on `README.md`, and you wanna update it.
```sh
git add README.md
```
Or you want to add ALL FILES.
```sh
git add .
```
Then, I may prepare your changes to PUSH github.
```sh
git commit -m "what kind of updates you made"
# -m message
```
> **WARNING**
> Do not write commit messages like "Update, Add, Some ...". Write meaningful commit messages, it helps you to move through your changes.
Then **PUSH** all of your changes:
```sh
git push
```