Git Tutorial
Git Crash Course using BitBucket
Author: Emad Zaamout
Sunday, October 24, 2021
Table of Contents
Introduction
Welcome back,
In this tutorial, we go through how to use Git for complete beginners.
We will be using BitBucket since Bitbucket is free for private repositories.
It does not matter what remote origin you use, pulling and pushing code is the same.
Git Commands
Set up User name and email - displayed in git history.
git config --global user.name "Emad Zaamout"
git config --global user.email "support@ahtcloud.com"
Change Git Default Editor.
git config --global core.editor emacs
git config --global core.editor nano
git config --global core.editor notepad
git config --global core.editor '"C:/Program Files/Notepad++/notepad++.exe"'
Check your Settings.
git config --list
Initializing a Repository in an Existing Directory.
git init
Close your remote repository locally.
git clone
Fetch modifications.
git pull
View Git status and your local changes.
git status
Add all files & commit.
git add .
git commit -m "My Commit Message"
Local branch - track a remote branch
git branch --set-upstream-to master origin/master
Show local + remote branches
git branch -a show remote branches only
git branch -r delete remote branch
Delete Remote Branch
git push -d remote_name branch_name
Delete Local Branch
git branch -d branch_name