Git
Here is a handy cheat sheet for git beginners:
Installation
Download Git from https://git-scm.com/ and follow the installation instructions for your operating system.
Configuration
Configure your name and email:
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
Create a new Git repository on desired directory
git init
Add and commit files
Add specific files or use a dot for all files in the current directory:
git add file1.txt file2.js
git add .
git commit -m "Initial commit"
Work with branches
Create a new branch:
git branch new-branch
Switch to a branch:
git checkout branch-name
Merge branches:
Switch to the target branch:
git checkout target-branch
Merge changes from the source branch:
git merge source-branch
Remote repositories
Connect local repository to a remote repository:
git remote add origin remote-url
Push changes to the remote repository:
git push origin branch-name (or main)
Pull changes from a remote repository:
git pull origin branch-name (or main)