Skip to content. | Skip to navigation

Personal tools


You are here: Home / Tutorial / Git GitHub

Git GitHub

設定檔 流程 認證 action

入門教學 Tutorial Video crlf eol Manage Company-wide Secrets Strategy to Reduce Frontend Build Time

$ git config --global ""
$ git config --global "Your Name"
$ git config --global core.autocrlf input

Git Workflow Use GitHub Like a Proper Human Being: non-technical advice Primer for Dummy 2FA Two-Factor Authentication Common Git Mistakes and how to fix them

Merge vs Rebase PyCon 2015 Talk on Advanced Git: Video Slide

Undo Commits: last commit HEAD~ vs HEAD^

git reset vs git checkout vs git revert

Hide Password when Checking Config File in Git Exclude Database Password when pushing to GitHub


$ git reset HEAD^

$ git rebase origin/master

直接 git fetch origin 再 git merge origin/master 的副作用: 1) 強制產生 merge commit: 在 conflict 情況下通常是必要的動作, 但除此之外會讓 log 顯得雜亂 2) 讓最新完整的修改埋在舊版本裡

突發狀況的因應: git rebase --continue ; git rebase --abort

git-svn merge vs rebase

case: wrong branch

Rewriting History

# Changing the Last Commit
$ git commit --amend

技術上,上述動作會修改 Commit 的 SHA-1 值,像是個微型的 Rebase 動作,如果已經 Push 的話,就不要再執行 Amend 動作。

Cherry Pick: from another repository

github-collective: team management

$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Remove Grok Dependency for Cover View.
Using index info to reconstruct a base tree...
M       CHANGES.rst
M       src/collective/cover/browser/
Falling back to patching base and 3-way merge...
Auto-merging src/collective/cover/browser/
CONFLICT (content): Merge conflict in src/collective/cover/browser/
Auto-merging CHANGES.rst
Failed to merge in the changes.
Patch failed at 0001 Remove Grok Dependency for Cover View.
The copy of the patch that failed is found in:

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

Full Log + Cherry Pick

$ git log --graph --decorate --pretty=oneline --abbrev-commit --all
import os

lines = """

for line in lines.split('\n'):
    if line == '': continue
    cmd = 'git clone ' + line

Git Bisect

Action: the branch lingers around until the end of time

Creating Online Key

Hugo + Travis + Netlify

GitLab CI Droid GitHub page