Git Commands - YamamotoDesu/Yamamoto-Notes GitHub Wiki

Development

Setting up a git branch

Git Command

Review where we left off

> git status (nothing to commit)
> git log (tab bar last commit)

Currently we are on the main branch.

> git branch

To do our work on a separate branch we use the command

> git checkout -b <branchname>

To get back to the main branch we can go:

> git checkout main

We can always delete it by going:

> git branch -D <branchname>

To switch branches:

> git checkout <branchname>
> git checkout main

To edit the committed message

> git commit --amend

To commit your working:

> git add .
> git commit -m "Sample View"
> git push

To save your work incrementally

> git add -p

To double check your commits

> git status

To Check commits by one line

> git log --pretty=oneline --no-merges
⚠️ **GitHub.com Fallback** ⚠️