Summary

Git has given us the ability to keep track of any changes we make to code and to work with other people on it such that we can be working on multiple parts of the same project, and someone else working on the same project can also be working on multiple parts of the same project on different branches.

Git bash basic commands

git clone https://github.com/mj-boruto/blog.git
git status
git add file_name
git add folder_name // add all files in that folder
git commit -am "message" //add all the files that has been changed in this directory and commit

git add file_name
git commit --amend (--no-edit) //update
git push

git log
git reset
git reset --hard <commmit>
git reset --hard origin/master

git pull

Branching

git branch
git checkout -b new_branch_name
git checkout branch_name
git merge branch_name

Merge Conflicts

  1. get rid of the commit markers
  2. modify the file
  3. commit and push

GitHub Pages

Repository name: user_name.github.io

Vim

  1. You start in “normal mode”
  2. i brings you to “insert mode”
  3. esc brings you back to “normal mode”
  4. :x equals :wq (:w save / :q exit)