KEINOS' Blog

Official blog of KEINOS but mostly for my own reference. A Japanese made in Mexico with Mexican quality. Who monkey around the jungle of codes. ;-)


Project maintained by KEINOS Hosted on GitHub Pages — Theme by mattgraham

INDEX


Git

Update from the remote repository (not upstream)

With --rebase option, you can update your local repository without creating a merge commit.

git pull --rebase

Append a commit to the previous commit

1 つ前のコミットに追加する方法。

git add .
git commit --amend --no-edit
git push --force
# One-liner
git add . && git commit --amend --no-edit && git push --force

Create Orphan Branch

git checkout --orphan <new-branch-name>

Rename branch from “master” to “main”

  1. Change the name and push the branch as below.
  # Rename
  git branch -m master main
  git push -u origin main
  1. Go to GitHub and change the default branch to main.

    • [Settings]-[Branches]-[Default branch]
  2. Delete the old “master” branch.