Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="zh-Hant-TW">
<head id="Head1" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>快評》陳時中玻璃心 - 短評 - 言論</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
# 建立資料夾
mkdir git-reset-demo
cd git-reset-demo
# 建立版本庫
git init
# 新增檔案 a.txt 並提交。
echo 'a.txt first commit' > a.txt
git add .
# 建立資料夾
mkdir git-branch-demo
cd git-branch-demo
start .
# 建立版本庫
git init
# 新增檔案 a.txt 並提交。
echo 'a.txt first commit' > a.txt
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# 建立資料夾
mkdir git-revert-demo
cd git-revert-demo
# 建立版本庫
git init
# 新增檔案 a.txt 並提交。
echo 'a.txt first commit' > a.txt
git add .
cherry-pick
挑選 <SHA1> 合併到本分支
# 建立資料夾 與 版本庫
mkdir git-cherry-pick-demo
cd git-cherry-pick-demo
git init
# 新增檔案 a.txt 並提交。
# 建立資料夾 與 版本庫
mkdir git-rebase-demo
cd git-rebase-demo
git init
# 新增檔案 a.txt、b.txt 並分別提交。
echo 'a.txt first commit' > a.txt
git add .
git commit -m 'a.txt first commit'
echo 'b.txt first commit' > b.txt
# 建立資料夾 與 版本庫
mkdir git-rebase-demo
cd git-rebase-demo
git init
# 新增檔案 a.txt、b.txt 並分別提交。
echo 'a.txt first commit' > a.txt
git add .
git commit -m 'a.txt first commit'
echo 'b.txt first commit' > b.txt
# 建立資料夾 與 版本庫
mkdir git-rebase-demo
cd git-rebase-demo
git init
# 新增檔案 a.txt、b.txt 並分別提交。
echo 'a.txt first commit' > a.txt
git add .
git commit -m 'a.txt first commit'
echo 'b.txt first commit' > b.txt
# 建立資料夾 與 版本庫
mkdir git-rebase-demo
cd git-rebase-demo
git init
# 新增檔案 a.txt ~ D.txt 並分別提交。
echo 'a.txt first commit' > a.txt
git add .
git commit -m 'a.txt first commit'
echo 'b.txt first commit' > b.txt