mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-06-16 12:54:01 -03:00
Compare commits
3 Commits
fcc7508195
...
ad82e06b32
Author | SHA1 | Date | |
---|---|---|---|
ad82e06b32 | |||
ee2b977217 | |||
9766b3714e |
@ -135,6 +135,9 @@
|
||||
- [我想 Git 忽略權限與檔案模式更動](#%E6%88%91%E6%83%B3-git-%E5%BF%BD%E7%95%A5%E6%AC%8A%E9%99%90%E8%88%87%E6%AA%94%E6%A1%88%E6%A8%A1%E5%BC%8F%E6%9B%B4%E5%8B%95)
|
||||
- [我想設定全域使用者資訊](#%E6%88%91%E6%83%B3%E8%A8%AD%E5%AE%9A%E5%85%A8%E5%9F%9F%E4%BD%BF%E7%94%A8%E8%80%85%E8%B3%87%E8%A8%8A)
|
||||
- [我不知道我做錯了什麼](#%E6%88%91%E4%B8%8D%E7%9F%A5%E9%81%93%E6%88%91%E5%81%9A%E9%8C%AF%E4%BA%86%E4%BB%80%E9%BA%BC)
|
||||
- [Git 快捷命令](#git-%E5%BF%AB%E6%8D%B7%E5%91%BD%E4%BB%A4)
|
||||
- [Git Bash](#git-bash)
|
||||
- [Windows 上的 PowerShell](#windows-%E4%B8%8A%E7%9A%84-powershell)
|
||||
- [其他資源](#%E5%85%B6%E4%BB%96%E8%B3%87%E6%BA%90)
|
||||
- [書籍](#%E6%9B%B8%E7%B1%8D)
|
||||
- [教學](#%E6%95%99%E5%AD%B8)
|
||||
@ -924,7 +927,7 @@ HEAD is now at a13b85e
|
||||
(21)$ git cherry-pick e3851e8
|
||||
```
|
||||
|
||||
這可能會造成衝突,參見〈[互動式重定基底](#interactive-rebase)・[衝突](#merge-conflict)〉來解決衝突。
|
||||
這可能會造成衝突,參見〈[互動式重定基底可能出現的問題](#%E4%BA%92%E5%8B%95%E5%BC%8F%E9%87%8D%E5%AE%9A%E5%9F%BA%E5%BA%95%E5%8F%AF%E8%83%BD%E5%87%BA%E7%8F%BE%E7%9A%84%E5%95%8F%E9%A1%8C)・[衝突](#%E8%A1%9D%E7%AA%81)〉來解決衝突。
|
||||
|
||||
同樣地,為 `5ea5173` 也創建一個分支,並把提交揀選到其上:
|
||||
|
||||
@ -1869,19 +1872,55 @@ $ git reset --hard 0254ea7
|
||||
|
||||
摘自[這裡](https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog)。
|
||||
|
||||
## Git 快捷命令
|
||||
|
||||
### Git Bash
|
||||
|
||||
如果你已經很熟悉以上命令的用法了,你可能會想創建一些快捷方式,讓你可以用很短的命令完成複雜的任務。
|
||||
|
||||
```sh
|
||||
alias sq=squash
|
||||
|
||||
function squash() {
|
||||
git rebase -i HEAD~$1
|
||||
}
|
||||
```
|
||||
|
||||
將以上命令複製至你的 `.bashrc` 或 `.bash_profile`。
|
||||
|
||||
### Windows 上的 PowerShell
|
||||
|
||||
Windows 上的 PowerShell 也可以設定別名與函式。將以下命令加到你位於 `$profile` 變數的設定檔,詳見微軟文件網頁的 [關於設定檔](https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_profiles)。
|
||||
|
||||
```powershell
|
||||
Set-Alias sq Squash-Commit
|
||||
|
||||
function Squash-Commit {
|
||||
git rebase -i HEAD~$1
|
||||
}
|
||||
```
|
||||
|
||||
# 其他資源
|
||||
|
||||
## 書籍
|
||||
|
||||
* [Pro Git](https://git-scm.com/book/en/v2)——Scott Chacon 的傑出書籍
|
||||
* [Learn Enough Git to Be Dangerous](https://www.learnenough.com/git-tutorial)——Michael Hartl 所著的從基礎開始的 Git 書籍
|
||||
* [Pro Git](https://git-scm.com/book/en/v2)——Scott Chacon 與 Ben Straub 合著的傑出書籍
|
||||
* [Git Internals](https://github.com/pluralsight/git-internals-pdf)——Scott Chacon 的另一本傑出書籍
|
||||
* [Nasa Handbook](https://www.nasa.gov/sites/default/files/atoms/files/nasa_systems_engineering_handbook.pdf)
|
||||
|
||||
## 教學
|
||||
|
||||
* [Learn Git branching](https://learngitbranching.js.org/)——一個基於網頁的互動式分支、合併、重定基底教學
|
||||
* [19 Git Tips For Everyday Use](https://www.alexkras.com/19-git-tips-for-everyday-use)——實用的 Git 一行命令列表
|
||||
* [Atlassian's Git tutorial](https://www.atlassian.com/git/tutorials)——從初學到熟練,正確掌握 Git 的教學
|
||||
* [Learn Git branching](https://learngitbranching.js.org/)——分支、合併、重定基底的互動式網頁教學
|
||||
* [Getting solid at Git rebase vs. merge](https://medium.com/@porteneuve/getting-solid-at-git-rebase-vs-merge-4fa1a48c53aa)
|
||||
* [git-workflow](https://github.com/asmeurer/git-workflow)——[Aaron Meurer](https://github.com/asmeurer) 的怎麼使用 Git 開源貢獻
|
||||
* [GitHub as a workflow](http://hugogiraudel.com/2015/08/13/github-as-a-workflow/)——GitHub 作為工作流程的趣事,特別是空拉取請求
|
||||
* [Git Commands and Best Practices Cheat Sheet](https://zeroturnaround.com/rebellabs/git-commands-and-best-practices-cheat-sheet)——一篇部落格中的 Git 小抄與更多解釋
|
||||
* [Git from the inside out](https://codewords.recurse.com/issues/two/git-from-the-inside-out)——深度探討 Git 內部的教學
|
||||
* [git-workflow](https://github.com/asmeurer/git-workflow) - [Aaron Meurer](https://github.com/asmeurer)——如何用 Git 貢獻開源版本庫
|
||||
* [GitHub as a workflow](https://hugogiraudel.com/2015/08/13/github-as-a-workflow/)——將 GitHub 用作工作流程的有趣做法,尤其是空 PR
|
||||
* [Githug](https://github.com/Gazler/githug)——學習常見 Git 工作流程的遊戲
|
||||
* [learnGitBranching](https://github.com/pcottle/learnGitBranching)——用於挑戰與教育的互動式 Git 可視化!
|
||||
|
||||
## 腳本和工具
|
||||
|
||||
@ -1890,7 +1929,7 @@ $ git reset --hard 0254ea7
|
||||
* [git-extras](https://github.com/tj/git-extras)——Git 工具集,版本庫概要、repl、歷史記錄、提交百分比和更多
|
||||
* [git-fire](https://github.com/qw3rtman/git-fire)——git-fire 是一個 Git 插件,用於在緊急情況下幫助加入目前所有檔案、提交、推送到一個新分支(防止合併衝突)。
|
||||
* [git-tips](https://github.com/git-tips/tips)——Git 小撇步
|
||||
* [git-town](https://github.com/Originate/git-town)——通用、高級 Git 工作流程支援! http://www.git-town.com
|
||||
* [git-town](https://github.com/Originate/git-town)——通用、高級 Git 工作流程支援!<http://www.git-town.com>
|
||||
|
||||
## GUI 客戶端
|
||||
|
||||
@ -1898,5 +1937,12 @@ $ git reset --hard 0254ea7
|
||||
* [git-cola](https://git-cola.github.io/)——又一個 Git 客戶端,適用於 Windows、OS X
|
||||
* [GitUp](https://github.com/git-up/GitUp)——一個新的 Git 客戶端,在解決 Git 的複雜問題上有自己的特點
|
||||
* [gitx-dev](https://rowanj.github.io/gitx/)——又一個圖形化的 Git 客戶端,適用於 OS X
|
||||
* [Source Tree](https://www.sourcetreeapp.com/)——簡單而強大的免費 Git GUI 客戶端,適用於 Windows、OS X
|
||||
* [Sourcetree](https://www.sourcetreeapp.com/)——簡單而強大的免費 Git GUI 客戶端,適用於 Windows、OS X
|
||||
* [Tower](http://www.git-tower.com/)——圖形化 Git 客戶端,適用於 OS X(付費)
|
||||
* [tig](https://jonas.github.io/tig/)——Git 的終端文本模式介面
|
||||
* [Magit](https://magit.vc/)——Emacs 的 Git 介面
|
||||
* [GitExtensions](https://github.com/gitextensions/gitextensions)——殼層插件、Visual Studio 2010-2015 插件、獨立的 Git 版本庫工具
|
||||
* [Fork](https://git-fork.com/)——快速且友善的 Git 客戶端,適用於 Mac(beta)
|
||||
* [gmaster](https://gmaster.io/)——包含三路合併、分析重構、語意化差異、合併等的 Git 客戶端,適用於 Windows(beta)
|
||||
* [gitk](https://git-scm.com/docs/gitk)——可以簡單查看版本庫狀態的 Git 客戶端,適用於 Linux
|
||||
* [SublimeMerge](https://www.sublimemerge.com/)——極速、可擴展的客戶端,有三路合併、強大的搜尋、語法高亮功能,活躍開發中
|
||||
|
Reference in New Issue
Block a user