Skip to content

Git Flow

Omar Barazanji edited this page Feb 6, 2023 · 1 revision

Cloning (first time)

  1. Cloning assistant for the first time:
git clone --recurse-submodules [email protected]:omarzanji/assistant.git

Pulling Changes

  1. Pulling latest changes:
git pull 

Making Changes (Branches)

  1. If you make any changes that you would like to commit, checkout a branch and commit changes to this branch:
git checkout -b yourname/branch-name

For example:

git checkout omar/fixed-database-responses-bug
  1. Committing changes to your new branch:
git add .
git commit -m "Write a small description about your changes here."
git push origin yourname/branch-name

Must Know Git Commands

  1. See which branch you are on as well as all other local and remote branches:
git branch
  1. Switching back to main branch:
git chekout main
  1. Switching back to another branch:
git checkout branchname
  1. How to force checking out main, over-writing any un-staged changes:
git stash
git checkout main
  1. Reset main to latest discarding all changes you made:
git reset --hard HEAD
  1. How to see log of all commits in current branch:
git log
Clone this wiki locally