Git Demo
git init: turns folder int a git folder
git status: get status of the git folder
git add <file> adds file to be commited
git commit -m "message"
clear to empty terminal
git log
git remote add origin <url>
git branch
git checkout -b <branch_name>
git merge <branch_name> merges the specific branch with the branch you are currently in
git reset --hard goes to the last id (destructive)
git push origin <branch_name> --force force a push (destructive)
Common Commands
git add -A # Add all files
- Create a new repository on GitHub
git init
- Create and add an ignore file
touch .gitignoregit add .gitignore
- Commit the changes
git commit -m "Initial commit"
- Add the remote repository
git remote add origin <url>
- Push the changes to the remote repository
git push origin <branch_name>
git add -Agit commit -m "message"git merge <branch_name>git push origin <branch_name>git push origin --tagsgit push origin <branch_name> --force