git --version
git config --global user.name "Your Name" git config --global user.email "hello@example.com"
git config --global init.Branch <name>
Example:git config --global init.Branch main
git init
git branch -m main
touch <file_name>
git branch <branch name>
git checkout <branch name>
Example:git branch feature-1
git checkout feature-1
git add .
ORgit add <file name>
git restore <file name>
Or check this command:
git reset HEAD <file name>
git commit -m <message what was changed in the code>
Example:git commit -m "Initial Commit"
git status
git log
git log --all --oneline
git checkout <branch name>
Example:git checkout main
ORgit checkout feature-1
Checkout the target branch:git checkout <target branch name>
Merge the source branch into the target branch:git merge <source branch name>
Example:git checkout main
git merge feature-1
git branch -d <branch name>
Example:git branch -d feature-1
git stash push
git stash list
git stash apply
git stash drop
git stash pop
git stash clear
git stash branch <branch name>
git push origin <branch name>
git remote -v
Open GitBash on C:\Users\raya\.sshssh-keygen -t ed25519 -C <your email>
Set to save it in the same folder under id_rsa_my_hight_pro New key will be saved in id_rsa_my_hight_pro* filesssh-keygen -t ed25519 -C "GitLab Key Pair"
Pay attention to the name of the file ORssh-keygen -t rsa -b 4096 -C <your email>
cat ~/.ssh/id_ed25519.pub
Copy the output to the clipboard.
Paste in the key field in the GitLab profile at GitLab SSH Keys.
Press on the Add Key.
ssh -T git@gitlab.com
Expected result: "Welcome to Gitlab <username>" message.
Left Side Menu > Groups > Create group
We can invite people using email address.
git clone <repo>
GitLab Home page > New Project button
Press on "Create Project" button.
Fill a slug, and Project name will be created automatically.
GitLab Home page > Settings > Default Branch
Set the default branch to "main"
GitLab Home page > Settings > Protected Branches
set a protected branch
GitLab Home page > Settings > Pages
A request to merge one branch into another.
Based on this video.
About GitLab flow see at 1:09:00 in the video.