Git is an essential tool for version control and collaboration in software development. This guide covers the fundamental Git commands that every beginner should know. From configuring your user information to managing branches and viewing logs, you'll learn the basics to get started with Git effectively.
Current config
bash
git config --listConfigure user and email
bash
git config --global user.name "Your Name"
git config --global user.email "email@email.com"Clone a repo
bash
git clone https://github.com/Benoit-Gaumard/ProjectNameGet the current branch status
bash
git statusStage a folder
bash
git add .Create a commit (local)
bash
git commit -m "feat: bga first commit"Push modifications to the remote branch
bash
git pushGet the last version of the repo from the remote branch
bash
git pullChange branch
bash
git checkout mybranchList local branches
bash
git branchList remote branches
bash
git branch -rList local and remote branches
bash
git branch -aDelete a branch (local)
bash
git branch -d my-branch-name
git branch -D my-branch-nameDisplay repo config
bash
git config --global --listLogs
bash
git log -v
git log -pCreate a branch (local)
bash
git branch my-new-branch
git checkout -b feat-azure-functionsDelete branch (remote)
bash
git push origin -d my-branchList modified files
bash
git diff -r --no-commit-id --name-onlyMisc
bash
gitk --all