Manage Branches

it is important to keep branches clean

# list your local branches
git branch

# switch branch
git switch BranchName

# create new branch and switch
git checkout -b NewBranchName

# delete
git branch -d LocalBranchName
git push origin --delete RemoteBranchName

# if add wrong file
git restore --staged FileName
git restor FileName

how to rebase: https://www.w3docs.com/snippets/git/how-to-rebase-git-branch.html

Pull & Push

How to push a local project to github

git init
git add .
git commit -m 'some commentary'

How to pull from remote

git pull
git stash
git pull
git stash apply    # or follow the error tips if something went wrong

How to withdraw last push

git reset --hard bae7c7d
git branch # check the branches
git push origin branch_name --force
git log # check submission log