Gitting-Started/README.md
2021-06-23 15:19:40 -04:00

76 lines
1.6 KiB
Markdown

# Gitting-Started
Getting started with Git
## I recommend WSL if using Windows. If using mac you already have terminal :-)
There are GUIs for Git, but I have no experience with them.
---
Installing WSL: [HERE](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
I recommend Debian OR Alpine
Alpine Linux: [HERE](https://www.microsoft.com/en-us/p/alpine-wsl/9p804crf0395)
Debian Linux: [HERE](https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6?activetab=pivot:overviewtab)
---
Create SSH Key
```ssh-keygen```
---
Get SSH public key
```cat ~/.ssh/id_rsa.pub```
---
Add key to gitea
1. User profile in upper right hand corner
2. Settings
3. SSH/GPG Keys
4. Manage SSH Keys -> Add Key (to the right)
5. Paste whole key in Content, this should add the SSH Key Name in the name field
---
Clone git repo
1. Find repo you want
2. Switch to SSH option in cloning
3. ```git clone URL_HERE```
---
Now you can do the git stuff
1. I always do a ```git pull``` to make sure the repo is up to date just in-case anyone has made changes
2. ```git add NEW_FILE``` or ```git add .``` if you'd like to add all files with changes
3. ```git commit -m 'ADD INFO HERE OF WHAT WAS CHANGED/ADDED'``` | If you'd like to push some changes, but not run the pipeline you can just add ```[skip ci]``` anywhere in the commit message
4. ```git push```
## Your updates will now be pushed, if there's a pipline it might take a while 10/15mins for the updates to be shown
---
Other useful git stuff
View status of repo (how far ahead/behind from master/main) | ```git status```
View differences | ```git diff```