Member-only story

How to use Git, everyday commands and internal

Weekly Dev Blog
4 min readFeb 8, 2021

--

Git

  • Everyday commands and workflow
  • Git internal

Everyday commands and workflow

I usually keep a file called command in the parent directory to remind me of things I don't want to remember

git checkout -b feature/new_branch # create new branch feature/new_branch from current branch
git commit -m 'message' # new snapshot
git commit --amend # append current change to previous snapshot
git pull --rebase origin develop # merge develop branch changes to local but put your changes on top
git push # sync local changes to remote
git push -f # force sync local changes to remote
git reset HEAD~ # undo last commit
git merge --continue # after solve conflict
git merge --abort # abort merging
git stash apply
git checkout stash -- . # force stash apply

Do the setup once, hopefully only once

git config --global credential.helper store
git config --global user.name "Your Name"
git config --global user.email "you@email"

just use UI for the following commands

git add
git diff
git stash # store latest change

Internals

--

--

No responses yet