Git Bash - abdulmukit98/techshopJU GitHub Wiki

Install Git-Bash (https://git-scm.com/downloads)

Authentication

git config --global user.name "Your name"
git config --global user.email "Your emaill"

Clone a repository

git clone "repository url"
git clone --branch "branchName" "branch url"

EX:
git clone https://github.com/abdulmukit98/abdulmukit98.github.io.git
git clone --branch orderPCB https://github.com/abdulmukit98/techshopJU.git
  • create branch
git checkout -b "new branch name"

to go to a branch
   git checkout "branch name"

Checkout -b will create a new branch, without -b and you switch to an existing branch

Check status

check what change is made

git status
git diff

Git push

push from local repository to remote repository

git add --all
git commit -m "what is done"

git push -u origin "branch name"
** git push -u origin main
** git push -u origin orderPCB

Git pull

fetch from remote repository

git pull

merge

  • To merge a branch, go to that branch
git checkout main
  • then marge "sample branch" with main branch
git merge "branch name"
  • then push main branch to remote repo
git push
no need -u since its already on server