Set username
git config --global user.name "Your Name Here"
Set e-mail
git config --global user.email "[email protected]"
Clorize and make git output pretty
git config --global color.ui true
Creating a repository
git init
Create a file
touch README.md
echo "Hello World" > README.md
Git status
git status
The file README.md we added above will show as untracked
Git add
Let's add our README.md to staging area
git add README.md
Git commit
Commit what we have in staging area to repository
git commit -m "Adding a README"
Git add remote origin
Add a remote so that we can sync our local repository
git remote add origin https://github.com/username/Hello-World.git
Create a new branch
git branch readme_update
Checkout (switch) to new branch
git checkout readme_update
A shortcut!
Create readme_update branch & checkout
git checkout -b readme_update
What branch are we on?
git status
or git branch
Make some changes to readme
Add to staging area
git add README.md
Git status
Do our changes to README show up in staging area?
git status
Git commit
git commit -m "Committing changes to readme"
Switch back to master
git checkout master
Merge our changes from readme_update
branch in
git merge readme_update
Delete readme_update
branch
git branch -d readme_update
Fetch grouped commits from log for release notes