<mohammadrony>

Basics of Git

Initialize Repository

git config --global init.defaultBranch main
git init

Set Remote URL

git remote add origin https://github.com/username/repository.git
git remove set-url origin https://github.com/username/repository.git

Config User for commit

git config --global user.email "user@example.com"
git config --global user.name "User Name"

Create Commit

Create new commit

git add .
git commit -m "Commit message." -m "Commit description."
git commit -a -m "Commit message."

Add Changes to Previous Commit

git commit --amend --no-edit

Pull Changes from Remote Repository

git pull origin main

Push new Change to Repository

Publish regular changes.

git push origin main

Override commits in remote repository

git push -f origin main