/git-tuto

A little README with some git stuff i might forget

How to use basic git! ๐Ÿ–ฅ

I made this repository for people who don't know how to use git and might want to start with it and for me when i eventually forget all of this stuff and need it!

Also i'm kinda aware that VSCode has it's own source code with github thingy on the side-bar, but i still think it's important to learn these kind of things

If i missed something i might update it some day

Be aware that to follow this tutorial you should have downloaded git and optionally CLI-GH (GitHub for command line)

You can download those here:

๐Ÿ““ Index

๐ŸŒฟ Setup:

git init
^ Initializes a local git repo

  • Now on other CLI using GH CLI you have to create a new repo

gh repo create git-tuto --private
^ Creates a private remote repo on your github account (you had to login before this lol!)
git remote add origin https://github.com/amyspark-ng/git-tuto.git
^ Adds the the remote URL as 'origin' (name of the remote)
git add .
^ Adds new or changed files
git branch -M main
^ Creates and moves to the main branch, even tho i think you can just set it as the default name or something like that
git commit -m "Initial commit ๐Ÿ˜Ž"
^ Commits those changes
git push -u origin main
^ Pushes the commits to the origin remote URL and to the main branch

๐Ÿงต Commiting

git add .
git commit -m "Changed stuff"
git push
^ Pushes all commits to current local branch to current remote URL

๐Ÿชถ Other useful commands

clear
^ You use this command to clear the git bash

git pull origin main
^ You can use this command to pull changes from the remote branch

git remote get-url origin
^ You can get the url of the origin remote URL

git remote rm origin
^ You can use this command to delete a remote URL

rm -fr .git
^ You use this command to delete the git stuff