- This is a sample repo for practicing Git & Github.
- All git commands that I used are below.
git config --global user.name "Rashindu Tharinda"
git config --global user.email [email protected]
git config --global init.default branch main
git config -h
git help config
git init
git status
git add index.htm
git rm --cached index.htm
git add --all | git add -A | git add .
git commit -m "first commit"
git diff
git restore --staged index.htm
git commit -a -m "skip staging area and commit"
git rm "secret recipe.htm"
git restore "secret recipe.htm"
git mv "KCC Logo.png" "Primary Logo.png"
git log
git log --oneline
git commit -m "amend previous commit" --amend
git log -p
git help log
git reset c193567
git rebase -i --root
git branch NewBranch
git branch
git switch NewBranch
git merge -m "merge NewBranch back to main" NewBranch
git branch -d NewBranch
git switch -c AnotherBranch
git merge AnotherBranch
git push --all
git fetch
git merge
git pull
- Create a folder and open it on CLI
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/itsme-rash522/repoName.git
git push -u origin main
- Open local repository(folder) on CLI
git remote add origin https://github.com/itsme-rash522/repoName.git
git branch -M main
git push -u origin main
git fetch origin main
git log origin main
git merge origin main
git rebase origin main
git push origin main