├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── enhancement_idea.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── pr-build.yml │ └── release-on-merge.yml ├── .gitignore ├── .mailmap ├── .tgitconfig ├── A-git-in-other-environments.asc ├── B-embedding-git-in-your-applications.asc ├── C-git-commands.asc ├── CITATION.cff ├── CONTRIBUTING.md ├── Gemfile ├── LICENSE.asc ├── Pro.ico ├── README.asc ├── Rakefile ├── SECURITY.md ├── TRANSLATING.md ├── TRANSLATION_NOTES.asc ├── atlas.json ├── book ├── 01-introduction │ └── sections │ │ ├── about-version-control.asc │ │ ├── command-line.asc │ │ ├── first-time-setup.asc │ │ ├── help.asc │ │ ├── history.asc │ │ ├── installing.asc │ │ └── what-is-git.asc ├── 02-git-basics │ └── sections │ │ ├── aliases.asc │ │ ├── getting-a-repository.asc │ │ ├── recording-changes.asc │ │ ├── remotes.asc │ │ ├── tagging.asc │ │ ├── undoing.asc │ │ └── viewing-history.asc ├── 03-git-branching │ └── sections │ │ ├── basic-branching-and-merging.asc │ │ ├── branch-management.asc │ │ ├── nutshell.asc │ │ ├── rebasing.asc │ │ ├── remote-branches.asc │ │ └── workflows.asc ├── 04-git-server │ └── sections │ │ ├── generating-ssh-key.asc │ │ ├── git-daemon.asc │ │ ├── git-on-a-server.asc │ │ ├── gitlab.asc │ │ ├── gitweb.asc │ │ ├── hosted.asc │ │ ├── protocols.asc │ │ ├── setting-up-server.asc │ │ └── smart-http.asc ├── 05-distributed-git │ └── sections │ │ ├── contributing.asc │ │ ├── distributed-workflows.asc │ │ └── maintaining.asc ├── 06-github │ ├── callouts │ │ ├── 1.pdf │ │ ├── 1.png │ │ ├── 10.pdf │ │ ├── 10.png │ │ ├── 2.pdf │ │ ├── 2.png │ │ ├── 3.pdf │ │ ├── 3.png │ │ ├── 4.pdf │ │ ├── 4.png │ │ ├── 5.pdf │ │ ├── 5.png │ │ ├── 6.pdf │ │ ├── 6.png │ │ ├── 7.pdf │ │ ├── 7.png │ │ ├── 8.pdf │ │ ├── 8.png │ │ ├── 9.pdf │ │ └── 9.png │ └── sections │ │ ├── 1-setting-up-account.asc │ │ ├── 2-contributing.asc │ │ ├── 3-maintaining.asc │ │ ├── 4-managing-organization.asc │ │ └── 5-scripting.asc ├── 07-git-tools │ ├── callouts │ │ ├── 1.pdf │ │ ├── 1.png │ │ ├── 10.pdf │ │ ├── 10.png │ │ ├── 2.pdf │ │ ├── 2.png │ │ ├── 3.pdf │ │ ├── 3.png │ │ ├── 4.pdf │ │ ├── 4.png │ │ ├── 5.pdf │ │ ├── 5.png │ │ ├── 6.pdf │ │ ├── 6.png │ │ ├── 7.pdf │ │ ├── 7.png │ │ ├── 8.pdf │ │ ├── 8.png │ │ ├── 9.pdf │ │ └── 9.png │ ├── git-credential-read-only │ └── sections │ │ ├── advanced-merging.asc │ │ ├── bundling.asc │ │ ├── credentials.asc │ │ ├── debugging.asc │ │ ├── interactive-staging.asc │ │ ├── replace.asc │ │ ├── rerere.asc │ │ ├── reset.asc │ │ ├── revision-selection.asc │ │ ├── rewriting-history.asc │ │ ├── searching.asc │ │ ├── signing.asc │ │ ├── stashing-cleaning.asc │ │ ├── submodules.asc │ │ └── subtree-merges.asc ├── 08-customizing-git │ └── sections │ │ ├── attributes.asc │ │ ├── config.asc │ │ ├── hooks.asc │ │ └── policy.asc ├── 09-git-and-other-scms │ └── sections │ │ ├── client-hg.asc │ │ ├── client-p4.asc │ │ ├── client-svn.asc │ │ ├── import-custom.asc │ │ ├── import-hg.asc │ │ ├── import-p4.asc │ │ └── import-svn.asc ├── 10-git-internals │ └── sections │ │ ├── environment.asc │ │ ├── maintenance.asc │ │ ├── objects.asc │ │ ├── packfiles.asc │ │ ├── plumbing-porcelain.asc │ │ ├── refs.asc │ │ ├── refspec.asc │ │ └── transfer-protocols.asc ├── A-git-in-other-environments │ └── sections │ │ ├── bash.asc │ │ ├── guis.asc │ │ ├── jetbrainsides.asc │ │ ├── powershell.asc │ │ ├── sublimetext.asc │ │ ├── visualstudio.asc │ │ ├── visualstudiocode.asc │ │ └── zsh.asc ├── B-embedding-git │ ├── callouts │ │ ├── 1.pdf │ │ ├── 1.png │ │ ├── 10.pdf │ │ ├── 10.png │ │ ├── 2.pdf │ │ ├── 2.png │ │ ├── 3.pdf │ │ ├── 3.png │ │ ├── 4.pdf │ │ ├── 4.png │ │ ├── 5.pdf │ │ ├── 5.png │ │ ├── 6.pdf │ │ ├── 6.png │ │ ├── 7.pdf │ │ ├── 7.png │ │ ├── 8.pdf │ │ ├── 8.png │ │ ├── 9.pdf │ │ └── 9.png │ └── sections │ │ ├── command-line.asc │ │ ├── dulwich.asc │ │ ├── go-git.asc │ │ ├── jgit.asc │ │ └── libgit2.asc ├── contributors.asc ├── cover.html ├── cover.png ├── dedication.asc ├── introduction.asc ├── license.asc ├── preface_ben.asc ├── preface_schacon.asc └── toc.asc ├── callouts ├── 1.pdf ├── 1.png ├── 10.pdf ├── 10.png ├── 2.pdf ├── 2.png ├── 3.pdf ├── 3.png ├── 4.pdf ├── 4.png ├── 5.pdf ├── 5.png ├── 6.pdf ├── 6.png ├── 7.pdf ├── 7.png ├── 8.pdf ├── 8.png ├── 9.pdf └── 9.png ├── ch01-getting-started.asc ├── ch02-git-basics-chapter.asc ├── ch03-git-branching.asc ├── ch04-git-on-the-server.asc ├── ch05-distributed-git.asc ├── ch06-github.asc ├── ch07-git-tools.asc ├── ch08-customizing-git.asc ├── ch09-git-and-other-systems.asc ├── ch10-git-internals.asc ├── diagram-source └── progit.sketch ├── images ├── 2fa-1.png ├── account-settings.png ├── advance-master.png ├── advance-master.svg ├── advance-testing.png ├── advance-testing.svg ├── areas.png ├── areas.svg ├── avatar-crop.png ├── basic-branching-1.png ├── basic-branching-1.svg ├── basic-branching-2.png ├── basic-branching-2.svg ├── basic-branching-3.png ├── basic-branching-3.svg ├── basic-branching-4.png ├── basic-branching-4.svg ├── basic-branching-5.png ├── basic-branching-5.svg ├── basic-branching-6.png ├── basic-branching-6.svg ├── basic-merging-1.png ├── basic-merging-1.svg ├── basic-merging-2.png ├── basic-merging-2.svg ├── basic-rebase-1.png ├── basic-rebase-1.svg ├── basic-rebase-2.png ├── basic-rebase-2.svg ├── basic-rebase-3.png ├── basic-rebase-3.svg ├── basic-rebase-4.png ├── basic-rebase-4.svg ├── benevolent-dictator.png ├── benevolent-dictator.svg ├── blink-01-start.png ├── blink-02-pr.png ├── blink-03-pull-request-open.png ├── blink-04-email.png ├── blink-04-pr-comment.png ├── blink-05-general-comment.png ├── blink-06-final.png ├── branch-and-history.png ├── branch-and-history.svg ├── branch_widget_mac.png ├── branch_widget_win.png ├── centralized.png ├── centralized.svg ├── centralized_workflow.png ├── checkout-master.png ├── checkout-master.svg ├── clean.png ├── clean.svg ├── collaborators.png ├── commit-and-tree.png ├── commit-and-tree.svg ├── commits-and-parents.png ├── commits-and-parents.svg ├── data-model-1.png ├── data-model-1.svg ├── data-model-2.png ├── data-model-2.svg ├── data-model-3.png ├── data-model-3.svg ├── data-model-4.png ├── data-model-4.svg ├── deltas.png ├── deltas.svg ├── distributed.png ├── distributed.svg ├── double-dot.png ├── double-dot.svg ├── email-settings.png ├── forkbutton.png ├── git-bash.png ├── git-diff-check.png ├── git-fusion-boot.png ├── git-fusion-perforce-graph.png ├── git-gui.png ├── git-instaweb.png ├── git-osx-installer.png ├── github_mac.png ├── github_win.png ├── gitk.png ├── gitlab-groups.png ├── gitlab-menu.png ├── gitlab-users.png ├── head-to-master.png ├── head-to-master.svg ├── head-to-testing.png ├── head-to-testing.svg ├── integration-manager.png ├── integration-manager.svg ├── interesting-rebase-1.png ├── interesting-rebase-1.svg ├── interesting-rebase-2.png ├── interesting-rebase-2.svg ├── interesting-rebase-3.png ├── interesting-rebase-3.svg ├── interesting-rebase-4.png ├── interesting-rebase-4.svg ├── interesting-rebase-5.png ├── interesting-rebase-5.svg ├── jb.png ├── large-merges-1.png ├── large-merges-1.svg ├── large-merges-2.png ├── large-merges-2.svg ├── lifecycle.png ├── lifecycle.svg ├── local.png ├── local.svg ├── lr-branches-1.png ├── lr-branches-1.svg ├── lr-branches-2.png ├── lr-branches-2.svg ├── maint-01-email.png ├── maint-02-merge.png ├── maint-03-email-resp.png ├── maint-04-target.png ├── maint-05-mentions.png ├── maint-06-unsubscribe.png ├── maint-07-notifications.png ├── maint-08-notifications-page.png ├── maint-09-contrib.png ├── maint-10-default-branch.png ├── maint-11-transfer.png ├── managed-team-1.png ├── managed-team-1.svg ├── managed-team-2.png ├── managed-team-2.svg ├── managed-team-3.png ├── managed-team-3.svg ├── managed-team-flow.png ├── managed-team-flow.svg ├── markdown-01-example.png ├── markdown-02-tasks.png ├── markdown-03-task-summary.png ├── markdown-04-fenced-code.png ├── markdown-05-quote.png ├── markdown-06-emoji-complete.png ├── markdown-07-emoji.png ├── markdown-08-drag-drop.png ├── mentions-01-syntax.png ├── mentions-02-render.png ├── mentions-03-closed.png ├── merging-workflows-1.png ├── merging-workflows-1.svg ├── merging-workflows-2.png ├── merging-workflows-2.svg ├── merging-workflows-3.png ├── merging-workflows-3.svg ├── merging-workflows-4.png ├── merging-workflows-4.svg ├── merging-workflows-5.png ├── merging-workflows-5.svg ├── new-repo.png ├── neworg.png ├── newrepo.png ├── newrepoform.png ├── orgs-01-page.png ├── orgs-02-teams.png ├── orgs-03-audit.png ├── p4merge.png ├── perils-of-rebasing-1.png ├── perils-of-rebasing-1.svg ├── perils-of-rebasing-2.png ├── perils-of-rebasing-2.svg ├── perils-of-rebasing-3.png ├── perils-of-rebasing-3.svg ├── perils-of-rebasing-4.png ├── perils-of-rebasing-4.svg ├── perils-of-rebasing-5.png ├── perils-of-rebasing-5.svg ├── posh-git.png ├── pr-01-fail.png ├── pr-02-merge-fix.png ├── public-small-1.png ├── public-small-1.svg ├── public-small-2.png ├── public-small-2.svg ├── public-small-3.png ├── public-small-3.svg ├── rebasing-1.png ├── rebasing-1.svg ├── rebasing-2.png ├── rebasing-2.svg ├── remote-branches-1.png ├── remote-branches-1.svg ├── remote-branches-2.png ├── remote-branches-2.svg ├── remote-branches-3.png ├── remote-branches-3.svg ├── remote-branches-4.png ├── remote-branches-4.svg ├── remote-branches-5.png ├── remote-branches-5.svg ├── replace1.png ├── replace1.svg ├── replace2.png ├── replace2.svg ├── replace3.png ├── replace3.svg ├── replace4.png ├── replace4.svg ├── replace5.png ├── replace5.svg ├── reposettingslink.png ├── rerere1.png ├── rerere1.svg ├── rerere2.png ├── rerere2.svg ├── rerere3.png ├── rerere3.svg ├── reset-checkout.png ├── reset-checkout.svg ├── reset-ex1.png ├── reset-ex1.svg ├── reset-ex2.png ├── reset-ex2.svg ├── reset-ex3.png ├── reset-ex3.svg ├── reset-ex4.png ├── reset-ex4.svg ├── reset-ex5.png ├── reset-ex5.svg ├── reset-ex6.png ├── reset-ex6.svg ├── reset-hard.png ├── reset-hard.svg ├── reset-mixed.png ├── reset-mixed.svg ├── reset-path1.png ├── reset-path1.svg ├── reset-path2.png ├── reset-path2.svg ├── reset-path3.png ├── reset-path3.svg ├── reset-soft.png ├── reset-soft.svg ├── reset-squash-r1.png ├── reset-squash-r1.svg ├── reset-squash-r2.png ├── reset-squash-r2.svg ├── reset-squash-r3.png ├── reset-squash-r3.svg ├── reset-start.png ├── reset-start.svg ├── reset-workflow.png ├── reset-workflow.svg ├── scripting-01-services.png ├── scripting-02-email-service.png ├── scripting-03-webhook.png ├── scripting-04-webhook-debug.png ├── scripting-05-access-token.png ├── scripting-06-comment.png ├── scripting-07-status.png ├── signup.png ├── small-team-1.png ├── small-team-1.svg ├── small-team-2.png ├── small-team-2.svg ├── small-team-3.png ├── small-team-3.svg ├── small-team-4.png ├── small-team-4.svg ├── small-team-5.png ├── small-team-5.svg ├── small-team-6.png ├── small-team-6.svg ├── small-team-7.png ├── small-team-7.svg ├── small-team-flow.png ├── small-team-flow.svg ├── smudge.png ├── smudge.svg ├── snapshots.png ├── snapshots.svg ├── ssh-keys.png ├── symbols.svg ├── topic-branches-1.png ├── topic-branches-1.svg ├── topic-branches-2.png ├── topic-branches-2.svg ├── two-branches.png ├── two-branches.svg ├── undomerge-reset.png ├── undomerge-reset.svg ├── undomerge-revert.png ├── undomerge-revert.svg ├── undomerge-revert2.png ├── undomerge-revert2.svg ├── undomerge-revert3.png ├── undomerge-revert3.svg ├── undomerge-start.png ├── undomerge-start.svg ├── your-profile.png ├── zsh-oh-my.png └── zsh-prompt.png ├── index.asc ├── progit.asc ├── status.json └── theme ├── epub ├── epub.css ├── epub.xsl └── layout.html ├── html ├── html.css └── html.xsl ├── mobi ├── mobi.css └── mobi.xsl └── pdf ├── pdf.css └── pdf.xsl /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Translation bug 4 | url: https://github.com/progit/progit2/blob/main/TRANSLATING.md 5 | about: Refer to this table to find out where to report translation bugs. 6 | 7 | - name: Report bugs for git-scm.com site 8 | url: https://github.com/git/git-scm.com/issues/ 9 | about: Please report problems with the git-scm.com site there. 10 | 11 | - name: Bug is about Git program itself 12 | url: https://git-scm.com/community 13 | about: Please report problems with the Git program there. 14 | 15 | - name: Bug is about Git for Windows 16 | url: https://github.com/git-for-windows/git/issues 17 | about: Please report problems with Git for Windows there. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement_idea.yml: -------------------------------------------------------------------------------- 1 | name: Enhancement idea 2 | description: Suggest an idea for the ProGit2 book or repository 3 | labels: ["enhancement"] 4 | body: 5 | - type: textarea 6 | attributes: 7 | label: General overview of your idea. 8 | description: Give a general overview of your idea. 9 | validations: 10 | required: true 11 | 12 | - type: textarea 13 | attributes: 14 | label: What problem will this solve? 15 | description: Explain what problem you're trying to solve. 16 | validations: 17 | required: true 18 | 19 | - type: textarea 20 | attributes: 21 | label: Have you thought about other solutions? 22 | description: Describe any alternative solutions to the problem. 23 | validations: 24 | required: false 25 | 26 | - type: dropdown 27 | attributes: 28 | label: Do you want to help with this enhancement idea? 29 | options: 30 | - "Yes" 31 | - "Maybe" 32 | - "No" 33 | validations: 34 | required: true 35 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for Ruby 4 | - package-ecosystem: "bundler" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" # Checks on Monday through Friday. 8 | 9 | # Maintain GitHub Action runners 10 | - package-ecosystem: "github-actions" 11 | directory: "/" 12 | schedule: 13 | interval: "daily" # Checks on Monday through Friday. 14 | 15 | # Set default reviewer and labels 16 | reviewers: 17 | - "ben" 18 | labels: 19 | - "dependabot" 20 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | - [ ] I provide my work under the [project license](https://github.com/progit/progit2/blob/main/LICENSE.asc). 7 | - [ ] I grant such license of my work as is required for the purposes of future print editions to [Ben Straub](https://github.com/ben) and [Scott Chacon](https://github.com/schacon). 8 | 9 | ## Changes 10 | 11 | - 12 | 13 | ## Context 14 | 24 | -------------------------------------------------------------------------------- /.github/workflows/pr-build.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Build 2 | 3 | on: 4 | pull_request: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | 13 | - name: Set up Ruby 14 | uses: ruby/setup-ruby@v1 15 | with: 16 | ruby-version: 3.1 17 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically 18 | 19 | - name: Build book 20 | run: bundle exec rake book:build 21 | -------------------------------------------------------------------------------- /.github/workflows/release-on-merge.yml: -------------------------------------------------------------------------------- 1 | name: Release on push to main 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | release: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: Set up Ruby 16 | uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: 3.1 19 | bundler-cache: true # runs 'bundle install' and caches installed gems automatically 20 | 21 | - name: Build release assets 22 | run: bundle exec rake book:build 23 | 24 | - name: Compute tag name 25 | id: compute-tag 26 | run: | 27 | echo Computing next tag number 28 | LASTPATCH=$(git describe --tags | cut -d- -f1 | cut -d. -f3) 29 | PATCH=$(($LASTPATCH+1)) 30 | echo "tagname=2.1.${PATCH}" >> $GITHUB_OUTPUT 31 | 32 | - name: Create release 33 | uses: ncipollo/release-action@v1 34 | with: 35 | token: ${{ secrets.GITHUB_TOKEN }} 36 | tag: ${{ steps.compute-tag.outputs.tagname }} 37 | commit: main 38 | artifacts: './progit.epub,./progit.fb2.zip,./progit.mobi,./progit.pdf,./progit.html' 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | .DS_Store 3 | 4 | # build artifacts 5 | Gemfile.lock 6 | progit.html 7 | progit.pdf 8 | progit.pdfmarks 9 | progit.epub 10 | progit.fb2.zip 11 | progit-kf8.epub 12 | progit.mobi 13 | contributors.txt -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Jean-Noël Avila 2 | Scott Chacon -------------------------------------------------------------------------------- /.tgitconfig: -------------------------------------------------------------------------------- 1 | [bugtraq] 2 | url = https://github.com/progit/progit2/issues/%BUGID% 3 | logregex = "(?:[Cc]lose[sd]?|[Ff]ix(?:e[sd])?|[Rr]esolve[sd]?):?\\s+(?:[Ii]ssues?\\s+#?|#)\\d+(?:(?:,|\\s+and)\\s+(?:[Ii]ssues?\\s+#?|#)\\d+)*\n(\\d+)" 4 | 5 | [tgit] 6 | icon = Pro.ico 7 | -------------------------------------------------------------------------------- /A-git-in-other-environments.asc: -------------------------------------------------------------------------------- 1 | [[A-git-in-other-environments]] 2 | [appendix] 3 | == Git in Other Environments 4 | 5 | If you read through the whole book, you've learned a lot about how to use Git at the command line. 6 | You can work with local files, connect your repository to others over a network, and work effectively with others. 7 | But the story doesn't end there; Git is usually used as part of a larger ecosystem, and the terminal isn't always the best way to work with it. 8 | Now we'll take a look at some of the other kinds of environments where Git can be useful, and how other applications (including yours) work alongside Git. 9 | 10 | include::book/A-git-in-other-environments/sections/guis.asc[] 11 | 12 | include::book/A-git-in-other-environments/sections/visualstudio.asc[] 13 | 14 | include::book/A-git-in-other-environments/sections/visualstudiocode.asc[] 15 | 16 | include::book/A-git-in-other-environments/sections/jetbrainsides.asc[] 17 | 18 | include::book/A-git-in-other-environments/sections/sublimetext.asc[] 19 | 20 | include::book/A-git-in-other-environments/sections/bash.asc[] 21 | 22 | include::book/A-git-in-other-environments/sections/zsh.asc[] 23 | 24 | include::book/A-git-in-other-environments/sections/powershell.asc[] 25 | 26 | === Summary 27 | 28 | You've learned how to harness Git's power from inside the tools that you use during your everyday work, and also how to access Git repositories from your own programs. 29 | -------------------------------------------------------------------------------- /B-embedding-git-in-your-applications.asc: -------------------------------------------------------------------------------- 1 | [[B-embedding-git-in-your-applications]] 2 | [appendix] 3 | == Embedding Git in your Applications 4 | 5 | If your application is for developers, chances are good that it could benefit from integration with source control. 6 | Even non-developer applications, such as document editors, could potentially benefit from version-control features, and Git's model works very well for many different scenarios. 7 | 8 | If you need to integrate Git with your application, you have essentially two options: spawn a shell and call the `git` command-line program, or embed a Git library into your application. 9 | Here we'll cover command-line integration and several of the most popular embeddable Git libraries. 10 | 11 | include::book/B-embedding-git/sections/command-line.asc[] 12 | 13 | include::book/B-embedding-git/sections/libgit2.asc[] 14 | 15 | include::book/B-embedding-git/sections/jgit.asc[] 16 | 17 | include::book/B-embedding-git/sections/go-git.asc[] 18 | 19 | include::book/B-embedding-git/sections/dulwich.asc[] 20 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | # This CITATION.cff file was generated with cffinit. 2 | # Visit https://bit.ly/cffinit to generate yours today! 3 | 4 | cff-version: 1.2.0 5 | title: Pro Git 6 | message: >- 7 | If you use this software, please cite it using the 8 | metadata from this file. 9 | type: software 10 | authors: 11 | - given-names: Scott 12 | family-names: Chacon 13 | email: schacon@gmail.com 14 | - given-names: Ben 15 | family-names: Straub 16 | email: ben@straub.cc 17 | identifiers: 18 | - type: url 19 | value: 'https://git-scm.com/book/en/v2' 20 | description: Pro Git website 21 | repository-code: 'https://github.com/progit/progit2' 22 | url: 'https://git-scm.com/book/en/v2' 23 | keywords: 24 | - git 25 | - book 26 | - asciidoc 27 | - pro-git 28 | license: CC-BY-NC-SA-3.0 29 | version: '2' 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Pro Git (2nd Edition) 2 | 3 | ## Licensing your work to us 4 | 5 | When you open a pull request, you agree to provide your work under the [project license](LICENSE.asc). 6 | Also, you agree to grant such license of your work as is required for the purposes of future print editions to @ben and @schacon. 7 | Should your changes appear in a printed edition, you'll be included in the [contributors list](book/contributors.asc). 8 | 9 | ## Signaling an Issue 10 | 11 | Search for similar issues, before creating a new issue. 12 | 13 | Also, if this issue has been spotted on the git-scm.com site, cross-check that the issue is present in the pdf version. 14 | The issue may have already been corrected in the source files, but not yet deployed to the git-scm.com site. 15 | 16 | ## Small Corrections 17 | 18 | Errata and basic clarifications will be accepted if we agree that they improve the content. 19 | You can also open an issue so that we can discuss how or if the issue needs to be addressed. 20 | 21 | If you've never done this before, the [flow guide](https://docs.github.com/en/get-started/quickstart/github-flow) might be useful. 22 | 23 | ## Large Rewrites 24 | 25 | Open an issue for discussion before you start. 26 | A large rewrite tends to be very subjective, often only clarifying things for a small amount of readers. 27 | Professional copy editors have already reviewed this content multiple times. 28 | It's unlikely that your prose is going to be *so* much better that it's worth changing large portions of text. 29 | 30 | ## Figures 31 | 32 | The images in this book are generated using [Sketch 3](https://www.sketch.com/), with the [included sketchbook file](diagram-source/progit.sketch). 33 | 34 | To create a figure: 35 | 36 | 1. Add a page to the sketchbook. 37 | Use the included symbols wherever possible. 38 | 2. Add a "slice" to your page. 39 | Name the slice so that it matches the destination PNG filename, relative from the root of the source directory. 40 | 3. Set your slice to export at "800w". 41 | 42 | ## Translations 43 | 44 | If you want to contribute to translating Pro Git into your language, take a look at [TRANSLATING.md](TRANSLATING.md). 45 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rake', '13.2.1' 4 | gem 'asciidoctor', '2.0.22' 5 | 6 | gem 'json', '2.9.1' 7 | gem 'awesome_print', '1.9.2' 8 | 9 | gem 'asciidoctor-fb2', '0.7.0' 10 | gem 'asciidoctor-epub3', '2.1.3' 11 | gem 'asciidoctor-pdf', '2.3.17' 12 | 13 | gem 'coderay', '1.1.3' 14 | gem 'pygments.rb', '2.4.1' 15 | gem 'thread_safe', '0.3.6' 16 | gem 'epubcheck-ruby', '5.2.0.0' 17 | gem 'html-proofer', '5.0.9' 18 | gem 'kindlegen', '3.1.1' 19 | -------------------------------------------------------------------------------- /LICENSE.asc: -------------------------------------------------------------------------------- 1 | This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 2 | To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0 or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. 3 | -------------------------------------------------------------------------------- /Pro.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/Pro.ico -------------------------------------------------------------------------------- /README.asc: -------------------------------------------------------------------------------- 1 | = Pro Git, Second Edition 2 | 3 | Welcome to the second edition of the Pro Git book. 4 | 5 | You can find this book online at: https://git-scm.com/book 6 | 7 | Like the first edition, the second edition of Pro Git is open source under a Creative Commons license. 8 | 9 | A couple of things have changed since open sourcing the first edition. 10 | For one, we've moved from Markdown to the amazing AsciiDoc format for the text of the book; here's an https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/[AsciiDoc quick reference]. 11 | 12 | We've also moved to keeping the translations in separate repositories rather than subdirectories of the English repository. 13 | See link:TRANSLATING.md[the translating document] for more information. 14 | 15 | == How To Generate the Book 16 | 17 | You can generate the e-book files manually with Asciidoctor. 18 | If you run the following you _may_ actually get HTML, Epub, Mobi and PDF output files: 19 | 20 | ---- 21 | $ bundle install 22 | $ bundle exec rake book:build 23 | Converting to HTML... 24 | -- HTML output at progit.html 25 | Converting to EPub... 26 | -- Epub output at progit.epub 27 | Converting to Mobi (kf8)... 28 | -- Mobi output at progit.mobi 29 | Converting to PDF... 30 | -- PDF output at progit.pdf 31 | ---- 32 | 33 | You can generate just one of the supported formats (HTML, EPUB, mobi, or PDF). 34 | Use one of the following commands: 35 | 36 | To generate the HTML book: 37 | 38 | ---- 39 | $ bundle exec rake book:build_html 40 | ---- 41 | 42 | To generate the EPUB book: 43 | 44 | ---- 45 | $ bundle exec rake book:build_epub 46 | ---- 47 | 48 | To generate the mobi book: 49 | 50 | ---- 51 | $ bundle exec rake book:build_mobi 52 | ---- 53 | 54 | To generate the PDF book: 55 | 56 | ---- 57 | $ bundle exec rake book:build_pdf 58 | ---- 59 | 60 | == Signaling an Issue 61 | 62 | Before signaling an issue, please check that there isn't already a similar one in the bug tracking system. 63 | 64 | Also, if this issue has been spotted on the git-scm.com site, please cross-check that it is still present in this repo. 65 | The issue may have already been corrected, but the changes have not been deployed yet. 66 | 67 | == Contributing 68 | 69 | If you'd like to help out by making a change, take a look at the link:CONTRIBUTING.md[contributor's guide]. 70 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Reporting a security issue 2 | 3 | If you find any security issue or vulnerability, please email [ben@straub.cc](mailto:ben@straub.cc) with your report. 4 | 5 | Do not open a issue on the `progit/progit2` repository or discuss the vulnerability in public. 6 | -------------------------------------------------------------------------------- /TRANSLATION_NOTES.asc: -------------------------------------------------------------------------------- 1 | == Translation Notes 2 | 3 | After forking this repository to translate the work, this file is where the notes for coordinating the translation work would go. 4 | Things like standardizing on words and expressions so that the work is consistent or notes on how the contributing process is to be handled. 5 | 6 | As a translation maintainer, also feel free to modify or completely rewrite the README file to contain instructions specific to your translation. 7 | 8 | === Translation Status 9 | 10 | As the work is translated, please update the `status.json` file to indicate the rough percentage complete each file is. 11 | This will be shown on various pages to let people know how much work is left to be done. 12 | -------------------------------------------------------------------------------- /atlas.json: -------------------------------------------------------------------------------- 1 | { 2 | "branch": "main", 3 | "files": [ 4 | "book/cover.html", 5 | "LICENSE.asc", 6 | "book/preface.asc", 7 | "book/contributors.asc", 8 | "book/introduction.asc", 9 | "book/toc.asc", 10 | "book/01-introduction/1-introduction.asc", 11 | "book/02-git-basics/1-git-basics.asc", 12 | "book/03-git-branching/1-git-branching.asc", 13 | "book/04-git-server/1-git-server.asc", 14 | "book/05-distributed-git/1-distributed-git.asc", 15 | "book/06-github/1-github.asc", 16 | "book/07-git-tools/1-git-tools.asc", 17 | "book/08-customizing-git/1-customizing-git.asc", 18 | "book/09-git-and-other-scms/1-git-and-other-scms.asc", 19 | "book/10-git-internals/1-git-internals.asc", 20 | "book/A-git-in-other-environments/1-git-other-environments.asc", 21 | "book/B-embedding-git/1-embedding-git.asc", 22 | "book/C-git-commands/1-git-commands.asc", 23 | "book/index.asc" 24 | ], 25 | "formats": { 26 | "pdf": { 27 | "version": "web", 28 | "index": true, 29 | "toc": true, 30 | "syntaxhighlighting": true, 31 | "show_comments": false 32 | }, 33 | "epub": { 34 | "index": true, 35 | "toc": true, 36 | "epubcheck": true, 37 | "embedded_fonts": [ 38 | "fonts/DejaVuSerif.otf", 39 | "fonts/DejaVuSans-Bold.otf", 40 | "fonts/hold/UbuntuMono-Bold.otf", 41 | "fonts/hold/UbuntuMono-BoldItalic.otf", 42 | "fonts/hold/UbuntuMono-Regular.otf", 43 | "fonts/hold/UbuntuMono-Italic.otf" 44 | ], 45 | "syntaxhighlighting": true, 46 | "show_comments": false 47 | }, 48 | "mobi": { 49 | "index": true, 50 | "toc": true, 51 | "embedded_fonts": [ 52 | "fonts/DejaVuSerif.otf", 53 | "fonts/DejaVuSans-Bold.otf", 54 | "fonts/hold/UbuntuMono-Bold.otf", 55 | "fonts/hold/UbuntuMono-BoldItalic.otf", 56 | "fonts/hold/UbuntuMono-Regular.otf", 57 | "fonts/hold/UbuntuMono-Italic.otf" 58 | ], 59 | "syntaxhighlighting": true, 60 | "show_comments": false 61 | }, 62 | "html": { 63 | "index": true, 64 | "toc": true, 65 | "syntaxhighlighting": true, 66 | "show_comments": false, 67 | "consolidate": false, 68 | "consolidated": false 69 | } 70 | }, 71 | "theme": "oreillymedia/atlas_tech1c_theme", 72 | "title": "Pro Git" 73 | } 74 | -------------------------------------------------------------------------------- /book/01-introduction/sections/command-line.asc: -------------------------------------------------------------------------------- 1 | === The Command Line 2 | 3 | There are a lot of different ways to use Git. 4 | There are the original command-line tools, and there are many graphical user interfaces of varying capabilities. 5 | For this book, we will be using Git on the command line. 6 | For one, the command line is the only place you can run _all_ Git commands -- most of the GUIs implement only a partial subset of Git functionality for simplicity. 7 | If you know how to run the command-line version, you can probably also figure out how to run the GUI version, while the opposite is not necessarily true. 8 | Also, while your choice of graphical client is a matter of personal taste, _all_ users will have the command-line tools installed and available. 9 | 10 | So we will expect you to know how to open Terminal in macOS or Command Prompt or PowerShell in Windows. 11 | If you don't know what we're talking about here, you may need to stop and research that quickly so that you can follow the rest of the examples and descriptions in this book. 12 | -------------------------------------------------------------------------------- /book/01-introduction/sections/help.asc: -------------------------------------------------------------------------------- 1 | [[_git_help]] 2 | === Getting Help 3 | 4 | If you ever need help while using Git, there are three equivalent ways to get the comprehensive manual page (manpage) help for any of the Git commands: 5 | 6 | [source,console] 7 | ---- 8 | $ git help 9 | $ git --help 10 | $ man git- 11 | ---- 12 | 13 | For example, you can get the manpage help for the `git config` command by running this:(((git commands, help))) 14 | 15 | [source,console] 16 | ---- 17 | $ git help config 18 | ---- 19 | 20 | These commands are nice because you can access them anywhere, even offline. 21 | If the manpages and this book aren't enough and you need in-person help, you can try the `#git`, `#github`, or `#gitlab` channels on the Libera Chat IRC server, which can be found at https://libera.chat/[^]. 22 | These channels are regularly filled with hundreds of people who are all very knowledgeable about Git and are often willing to help.(((IRC))) 23 | 24 | In addition, if you don't need the full-blown manpage help, but just need a quick refresher on the available options for a Git command, you can ask for the more concise "`help`" output with the `-h` option, as in: 25 | 26 | [source,console] 27 | ---- 28 | $ git add -h 29 | usage: git add [] [--] ... 30 | 31 | -n, --dry-run dry run 32 | -v, --verbose be verbose 33 | 34 | -i, --interactive interactive picking 35 | -p, --patch select hunks interactively 36 | -e, --edit edit current diff and apply 37 | -f, --force allow adding otherwise ignored files 38 | -u, --update update tracked files 39 | --renormalize renormalize EOL of tracked files (implies -u) 40 | -N, --intent-to-add record only the fact that the path will be added later 41 | -A, --all add changes from all tracked and untracked files 42 | --ignore-removal ignore paths removed in the working tree (same as --no-all) 43 | --refresh don't add, only refresh the index 44 | --ignore-errors just skip files which cannot be added because of errors 45 | --ignore-missing check if - even missing - files are ignored in dry run 46 | --sparse allow updating entries outside of the sparse-checkout cone 47 | --chmod (+|-)x override the executable bit of the listed files 48 | --pathspec-from-file read pathspec from file 49 | --pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character 50 | ---- 51 | -------------------------------------------------------------------------------- /book/01-introduction/sections/history.asc: -------------------------------------------------------------------------------- 1 | === A Short History of Git 2 | 3 | As with many great things in life, Git began with a bit of creative destruction and fiery controversy. 4 | 5 | The Linux kernel is an open source software project of fairly large scope.(((Linux))) 6 | During the early years of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files. 7 | In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.(((BitKeeper))) 8 | 9 | In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool's free-of-charge status was revoked. 10 | This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool based on some of the lessons they learned while using BitKeeper.(((Linus Torvalds))) 11 | Some of the goals of the new system were as follows: 12 | 13 | * Speed 14 | * Simple design 15 | * Strong support for non-linear development (thousands of parallel branches) 16 | * Fully distributed 17 | * Able to handle large projects like the Linux kernel efficiently (speed and data size) 18 | 19 | Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities. 20 | It's amazingly fast, it's very efficient with large projects, and it has an incredible branching system for non-linear development (see <>). 21 | -------------------------------------------------------------------------------- /book/02-git-basics/sections/aliases.asc: -------------------------------------------------------------------------------- 1 | [[_git_aliases]] 2 | === Git Aliases 3 | 4 | (((aliases))) 5 | Before we move on to the next chapter, we want to introduce a feature that can make your Git experience simpler, easier, and more familiar: aliases. 6 | For clarity's sake, we won't be using them anywhere else in this book, but if you go on to use Git with any regularity, aliases are something you should know about. 7 | 8 | Git doesn't automatically infer your command if you type it in partially. 9 | If you don't want to type the entire text of each of the Git commands, you can easily set up an alias for each command using `git config`.(((git commands, config))) 10 | Here are a couple of examples you may want to set up: 11 | 12 | [source,console] 13 | ---- 14 | $ git config --global alias.co checkout 15 | $ git config --global alias.br branch 16 | $ git config --global alias.ci commit 17 | $ git config --global alias.st status 18 | ---- 19 | 20 | This means that, for example, instead of typing `git commit`, you just need to type `git ci`. 21 | As you go on using Git, you'll probably use other commands frequently as well; don't hesitate to create new aliases. 22 | 23 | This technique can also be very useful in creating commands that you think should exist. 24 | For example, to correct the usability problem you encountered with unstaging a file, you can add your own unstage alias to Git: 25 | 26 | [source,console] 27 | ---- 28 | $ git config --global alias.unstage 'reset HEAD --' 29 | ---- 30 | 31 | This makes the following two commands equivalent: 32 | 33 | [source,console] 34 | ---- 35 | $ git unstage fileA 36 | $ git reset HEAD -- fileA 37 | ---- 38 | 39 | This seems a bit clearer. 40 | It's also common to add a `last` command, like this: 41 | 42 | [source,console] 43 | ---- 44 | $ git config --global alias.last 'log -1 HEAD' 45 | ---- 46 | 47 | This way, you can see the last commit easily: 48 | 49 | [source,console] 50 | ---- 51 | $ git last 52 | commit 66938dae3329c7aebe598c2246a8e6af90d04646 53 | Author: Josh Goebel 54 | Date: Tue Aug 26 19:48:51 2008 +0800 55 | 56 | Test for current head 57 | 58 | Signed-off-by: Scott Chacon 59 | ---- 60 | 61 | As you can tell, Git simply replaces the new command with whatever you alias it for. 62 | However, maybe you want to run an external command, rather than a Git subcommand. 63 | In that case, you start the command with a `!` character. 64 | This is useful if you write your own tools that work with a Git repository. 65 | We can demonstrate by aliasing `git visual` to run `gitk`: 66 | 67 | [source,console] 68 | ---- 69 | $ git config --global alias.visual '!gitk' 70 | ---- 71 | -------------------------------------------------------------------------------- /book/02-git-basics/sections/getting-a-repository.asc: -------------------------------------------------------------------------------- 1 | [[_getting_a_repo]] 2 | === Getting a Git Repository 3 | 4 | You typically obtain a Git repository in one of two ways: 5 | 6 | 1. You can take a local directory that is currently not under version control, and turn it into a Git repository, or 7 | 2. You can _clone_ an existing Git repository from elsewhere. 8 | 9 | In either case, you end up with a Git repository on your local machine, ready for work. 10 | 11 | ==== Initializing a Repository in an Existing Directory 12 | 13 | If you have a project directory that is currently not under version control and you want to start controlling it with Git, you first need to go to that project's directory. 14 | If you've never done this, it looks a little different depending on which system you're running: 15 | 16 | for Linux: 17 | [source,console] 18 | ---- 19 | $ cd /home/user/my_project 20 | ---- 21 | for macOS: 22 | [source,console] 23 | ---- 24 | $ cd /Users/user/my_project 25 | ---- 26 | for Windows: 27 | [source,console] 28 | ---- 29 | $ cd C:/Users/user/my_project 30 | ---- 31 | 32 | and type: 33 | 34 | [source,console] 35 | ---- 36 | $ git init 37 | ---- 38 | 39 | This creates a new subdirectory named `.git` that contains all of your necessary repository files -- a Git repository skeleton. 40 | At this point, nothing in your project is tracked yet. 41 | See <> for more information about exactly what files are contained in the `.git` directory you just created.(((git commands, init))) 42 | 43 | If you want to start version-controlling existing files (as opposed to an empty directory), you should probably begin tracking those files and do an initial commit. 44 | You can accomplish that with a few `git add` commands that specify the files you want to track, followed by a `git commit`: 45 | 46 | [source,console] 47 | ---- 48 | $ git add *.c 49 | $ git add LICENSE 50 | $ git commit -m 'Initial project version' 51 | ---- 52 | 53 | We'll go over what these commands do in just a minute. 54 | At this point, you have a Git repository with tracked files and an initial commit. 55 | 56 | [[_git_cloning]] 57 | ==== Cloning an Existing Repository 58 | 59 | If you want to get a copy of an existing Git repository -- for example, a project you'd like to contribute to -- the command you need is `git clone`. 60 | If you're familiar with other VCSs such as Subversion, you'll notice that the command is "clone" and not "checkout". 61 | This is an important distinction -- instead of getting just a working copy, Git receives a full copy of nearly all data that the server has. 62 | Every version of every file for the history of the project is pulled down by default when you run `git clone`. 63 | In fact, if your server disk gets corrupted, you can often use nearly any of the clones on any client to set the server back to the state it was in when it was cloned (you may lose some server-side hooks and such, but all the versioned data would be there -- see <> for more details). 64 | 65 | You clone a repository with `git clone `.(((git commands, clone))) 66 | For example, if you want to clone the Git linkable library called `libgit2`, you can do so like this: 67 | 68 | [source,console] 69 | ---- 70 | $ git clone https://github.com/libgit2/libgit2 71 | ---- 72 | 73 | That creates a directory named `libgit2`, initializes a `.git` directory inside it, pulls down all the data for that repository, and checks out a working copy of the latest version. 74 | If you go into the new `libgit2` directory that was just created, you'll see the project files in there, ready to be worked on or used. 75 | 76 | If you want to clone the repository into a directory named something other than `libgit2`, you can specify the new directory name as an additional argument: 77 | 78 | [source,console] 79 | ---- 80 | $ git clone https://github.com/libgit2/libgit2 mylibgit 81 | ---- 82 | 83 | That command does the same thing as the previous one, but the target directory is called `mylibgit`. 84 | 85 | Git has a number of different transfer protocols you can use. 86 | The previous example uses the `https://` protocol, but you may also see `git://` or `user@server:path/to/repo.git`, which uses the SSH transfer protocol. 87 | <> will introduce all of the available options the server can set up to access your Git repository and the pros and cons of each. 88 | -------------------------------------------------------------------------------- /book/04-git-server/sections/generating-ssh-key.asc: -------------------------------------------------------------------------------- 1 | [[_generate_ssh_key]] 2 | === Generating Your SSH Public Key 3 | 4 | (((SSH keys))) 5 | Many Git servers authenticate using SSH public keys. 6 | In order to provide a public key, each user in your system must generate one if they don't already have one. 7 | This process is similar across all operating systems. 8 | First, you should check to make sure you don't already have a key. 9 | By default, a user's SSH keys are stored in that user's `~/.ssh` directory. 10 | You can easily check to see if you have a key already by going to that directory and listing the contents: 11 | 12 | [source,console] 13 | ---- 14 | $ cd ~/.ssh 15 | $ ls 16 | authorized_keys2 id_dsa known_hosts 17 | config id_dsa.pub 18 | ---- 19 | 20 | You're looking for a pair of files named something like `id_dsa` or `id_rsa` and a matching file with a `.pub` extension. 21 | The `.pub` file is your public key, and the other file is the corresponding private key. 22 | If you don't have these files (or you don't even have a `.ssh` directory), you can create them by running a program called `ssh-keygen`, which is provided with the SSH package on Linux/macOS systems and comes with Git for Windows: 23 | 24 | [source,console] 25 | ---- 26 | $ ssh-keygen -o 27 | Generating public/private rsa key pair. 28 | Enter file in which to save the key (/home/schacon/.ssh/id_rsa): 29 | Created directory '/home/schacon/.ssh'. 30 | Enter passphrase (empty for no passphrase): 31 | Enter same passphrase again: 32 | Your identification has been saved in /home/schacon/.ssh/id_rsa. 33 | Your public key has been saved in /home/schacon/.ssh/id_rsa.pub. 34 | The key fingerprint is: 35 | d0:82:24:8e:d7:f1:bb:9b:33:53:96:93:49:da:9b:e3 schacon@mylaptop.local 36 | ---- 37 | 38 | First it confirms where you want to save the key (`.ssh/id_rsa`), and then it asks twice for a passphrase, which you can leave empty if you don't want to type a password when you use the key. 39 | However, if you do use a password, make sure to add the `-o` option; it saves the private key in a format that is more resistant to brute-force password cracking than is the default format. 40 | You can also use the `ssh-agent` tool to prevent having to enter the password each time. 41 | 42 | Now, each user that does this has to send their public key to you or whoever is administrating the Git server (assuming you're using an SSH server setup that requires public keys). 43 | All they have to do is copy the contents of the `.pub` file and email it. 44 | The public keys look something like this: 45 | 46 | [source,console] 47 | ---- 48 | $ cat ~/.ssh/id_rsa.pub 49 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU 50 | GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3 51 | Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA 52 | t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En 53 | mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx 54 | NrRFi9wrf+M7Q== schacon@mylaptop.local 55 | ---- 56 | 57 | For a more in-depth tutorial on creating an SSH key on multiple operating systems, see the GitHub guide on SSH keys at https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent[^]. 58 | -------------------------------------------------------------------------------- /book/04-git-server/sections/git-daemon.asc: -------------------------------------------------------------------------------- 1 | === Git Daemon 2 | 3 | (((serving repositories, git protocol))) 4 | Next we'll set up a daemon serving repositories using the "`Git`" protocol. 5 | This is a common choice for fast, unauthenticated access to your Git data. 6 | Remember that since this is not an authenticated service, anything you serve over this protocol is public within its network. 7 | 8 | If you're running this on a server outside your firewall, it should be used only for projects that are publicly visible to the world. 9 | If the server you're running it on is inside your firewall, you might use it for projects that a large number of people or computers (continuous integration or build servers) have read-only access to, when you don't want to have to add an SSH key for each. 10 | 11 | In any case, the Git protocol is relatively easy to set up. 12 | Basically, you need to run this command in a daemonized manner:(((git commands, daemon))) 13 | 14 | [source,console] 15 | ---- 16 | $ git daemon --reuseaddr --base-path=/srv/git/ /srv/git/ 17 | ---- 18 | 19 | The `--reuseaddr` option allows the server to restart without waiting for old connections to time out, while the `--base-path` option allows people to clone projects without specifying the entire path, and the path at the end tells the Git daemon where to look for repositories to export. 20 | If you're running a firewall, you'll also need to punch a hole in it at port 9418 on the box you're setting this up on. 21 | 22 | You can daemonize this process a number of ways, depending on the operating system you're running. 23 | 24 | Since `systemd` is the most common init system among modern Linux distributions, you can use it for that purpose. 25 | Simply place a file in `/etc/systemd/system/git-daemon.service` with these contents: 26 | 27 | [source,console] 28 | ---- 29 | [Unit] 30 | Description=Start Git Daemon 31 | 32 | [Service] 33 | ExecStart=/usr/bin/git daemon --reuseaddr --base-path=/srv/git/ /srv/git/ 34 | 35 | Restart=always 36 | RestartSec=500ms 37 | 38 | StandardOutput=syslog 39 | StandardError=syslog 40 | SyslogIdentifier=git-daemon 41 | 42 | User=git 43 | Group=git 44 | 45 | [Install] 46 | WantedBy=multi-user.target 47 | ---- 48 | 49 | You might have noticed that Git daemon is started here with `git` as both group and user. 50 | Modify it to fit your needs and make sure the provided user exists on the system. 51 | Also, check that the Git binary is indeed located at `/usr/bin/git` and change the path if necessary. 52 | 53 | Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and can start and stop the service with, respectively, `systemctl start git-daemon` and `systemctl stop git-daemon`. 54 | 55 | On other systems, you may want to use `xinetd`, a script in your `sysvinit` system, or something else -- as long as you get that command daemonized and watched somehow. 56 | 57 | Next, you have to tell Git which repositories to allow unauthenticated Git server-based access to. 58 | You can do this in each repository by creating a file named `git-daemon-export-ok`. 59 | 60 | [source,console] 61 | ---- 62 | $ cd /path/to/project.git 63 | $ touch git-daemon-export-ok 64 | ---- 65 | 66 | The presence of that file tells Git that it's OK to serve this project without authentication. 67 | -------------------------------------------------------------------------------- /book/04-git-server/sections/gitweb.asc: -------------------------------------------------------------------------------- 1 | === GitWeb 2 | 3 | (((serving repositories, GitWeb)))(((GitWeb))) 4 | Now that you have basic read/write and read-only access to your project, you may want to set up a simple web-based visualizer. 5 | Git comes with a CGI script called GitWeb that is sometimes used for this. 6 | 7 | [[gitweb]] 8 | .The GitWeb web-based user interface 9 | image::images/git-instaweb.png[The GitWeb web-based user interface] 10 | 11 | If you want to check out what GitWeb would look like for your project, Git comes with a command to fire up a temporary instance if you have a lightweight web server on your system like `lighttpd` or `webrick`. 12 | On Linux machines, `lighttpd` is often installed, so you may be able to get it to run by typing `git instaweb` in your project directory. 13 | If you're running macOS, Leopard comes preinstalled with Ruby, so `webrick` may be your best bet. 14 | To start `instaweb` with a non-lighttpd handler, you can run it with the `--httpd` option.(((git commands, instaweb))) 15 | 16 | [source,console] 17 | ---- 18 | $ git instaweb --httpd=webrick 19 | [2009-02-21 10:02:21] INFO WEBrick 1.3.1 20 | [2009-02-21 10:02:21] INFO ruby 1.8.6 (2008-03-03) [universal-darwin9.0] 21 | ---- 22 | 23 | That starts up an HTTPD server on port 1234 and then automatically starts a web browser that opens on that page. 24 | It's pretty easy on your part. 25 | When you're done and want to shut down the server, you can run the same command with the `--stop` option: 26 | 27 | [source,console] 28 | ---- 29 | $ git instaweb --httpd=webrick --stop 30 | ---- 31 | 32 | If you want to run the web interface on a server all the time for your team or for an open source project you're hosting, you'll need to set up the CGI script to be served by your normal web server. 33 | Some Linux distributions have a `gitweb` package that you may be able to install via `apt` or `dnf`, so you may want to try that first. 34 | We'll walk through installing GitWeb manually very quickly. 35 | First, you need to get the Git source code, which GitWeb comes with, and generate the custom CGI script: 36 | 37 | [source,console] 38 | ---- 39 | $ git clone https://git.kernel.org/pub/scm/git/git.git 40 | $ cd git/ 41 | $ make GITWEB_PROJECTROOT="/srv/git" prefix=/usr gitweb 42 | SUBDIR gitweb 43 | SUBDIR ../ 44 | make[2]: `GIT-VERSION-FILE' is up to date. 45 | GEN gitweb.cgi 46 | GEN static/gitweb.js 47 | $ sudo cp -Rf gitweb /var/www/ 48 | ---- 49 | 50 | Notice that you have to tell the command where to find your Git repositories with the `GITWEB_PROJECTROOT` variable. 51 | Now, you need to make Apache use CGI for that script, for which you can add a VirtualHost: 52 | 53 | [source,console] 54 | ---- 55 | 56 | ServerName gitserver 57 | DocumentRoot /var/www/gitweb 58 | 59 | Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch 60 | AllowOverride All 61 | order allow,deny 62 | Allow from all 63 | AddHandler cgi-script cgi 64 | DirectoryIndex gitweb.cgi 65 | 66 | 67 | ---- 68 | 69 | Again, GitWeb can be served with any CGI or Perl capable web server; if you prefer to use something else, it shouldn't be difficult to set up. 70 | At this point, you should be able to visit `http://gitserver/` to view your repositories online. 71 | -------------------------------------------------------------------------------- /book/04-git-server/sections/hosted.asc: -------------------------------------------------------------------------------- 1 | === Third Party Hosted Options 2 | 3 | If you don't want to go through all of the work involved in setting up your own Git server, you have several options for hosting your Git projects on an external dedicated hosting site. 4 | Doing so offers a number of advantages: a hosting site is generally quick to set up and easy to start projects on, and no server maintenance or monitoring is involved. 5 | Even if you set up and run your own server internally, you may still want to use a public hosting site for your open source code -- it's generally easier for the open source community to find and help you with. 6 | 7 | These days, you have a huge number of hosting options to choose from, each with different advantages and disadvantages. 8 | To see an up-to-date list, check out the GitHosting page on the main Git wiki at https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitHosting.html[^]. 9 | 10 | We'll cover using GitHub in detail in <>, as it is the largest Git host out there and you may need to interact with projects hosted on it in any case, but there are dozens more to choose from should you not want to set up your own Git server. 11 | -------------------------------------------------------------------------------- /book/04-git-server/sections/smart-http.asc: -------------------------------------------------------------------------------- 1 | === Smart HTTP 2 | 3 | (((serving repositories, HTTP))) 4 | We now have authenticated access through SSH and unauthenticated access through `git://`, but there is also a protocol that can do both at the same time. 5 | Setting up Smart HTTP is basically just enabling a CGI script that is provided with Git called `git-http-backend` on the server.(((git commands, "http-backend"))) 6 | This CGI will read the path and headers sent by a `git fetch` or `git push` to an HTTP URL and determine if the client can communicate over HTTP (which is true for any client since version 1.6.6). 7 | If the CGI sees that the client is smart, it will communicate smartly with it; otherwise it will fall back to the dumb behavior (so it is backward compatible for reads with older clients). 8 | 9 | Let's walk through a very basic setup. 10 | We'll set this up with Apache as the CGI server. 11 | If you don't have Apache setup, you can do so on a Linux box with something like this:(((Apache))) 12 | 13 | [source,console] 14 | ---- 15 | $ sudo apt-get install apache2 apache2-utils 16 | $ a2enmod cgi alias env 17 | ---- 18 | 19 | This also enables the `mod_cgi`, `mod_alias`, and `mod_env` modules, which are all needed for this to work properly. 20 | 21 | You'll also need to set the Unix user group of the `/srv/git` directories to `www-data` so your web server can read- and write-access the repositories, because the Apache instance running the CGI script will (by default) be running as that user: 22 | 23 | [source,console] 24 | ---- 25 | $ chgrp -R www-data /srv/git 26 | ---- 27 | 28 | Next we need to add some things to the Apache configuration to run the `git-http-backend` as the handler for anything coming into the `/git` path of your web server. 29 | 30 | [source,console] 31 | ---- 32 | SetEnv GIT_PROJECT_ROOT /srv/git 33 | SetEnv GIT_HTTP_EXPORT_ALL 34 | ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ 35 | ---- 36 | 37 | If you leave out `GIT_HTTP_EXPORT_ALL` environment variable, then Git will only serve to unauthenticated clients the repositories with the `git-daemon-export-ok` file in them, just like the Git daemon did. 38 | 39 | Finally you'll want to tell Apache to allow requests to `git-http-backend` and make writes be authenticated somehow, possibly with an Auth block like this: 40 | 41 | [source,console] 42 | ---- 43 | 44 | AuthType Basic 45 | AuthName "Git Access" 46 | AuthUserFile /srv/git/.htpasswd 47 | Require expr !(%{QUERY_STRING} -strmatch '*service=git-receive-pack*' || %{REQUEST_URI} =~ m#/git-receive-pack$#) 48 | Require valid-user 49 | 50 | ---- 51 | 52 | That will require you to create a `.htpasswd` file containing the passwords of all the valid users. 53 | Here is an example of adding a "`schacon`" user to the file: 54 | 55 | [source,console] 56 | ---- 57 | $ htpasswd -c /srv/git/.htpasswd schacon 58 | ---- 59 | 60 | There are tons of ways to have Apache authenticate users, you'll have to choose and implement one of them. 61 | This is just the simplest example we could come up with. 62 | You'll also almost certainly want to set this up over SSL so all this data is encrypted. 63 | 64 | We don't want to go too far down the rabbit hole of Apache configuration specifics, since you could well be using a different server or have different authentication needs. 65 | The idea is that Git comes with a CGI called `git-http-backend` that when invoked will do all the negotiation to send and receive data over HTTP. 66 | It does not implement any authentication itself, but that can easily be controlled at the layer of the web server that invokes it. 67 | You can do this with nearly any CGI-capable web server, so go with the one that you know best. 68 | 69 | [NOTE] 70 | ==== 71 | For more information on configuring authentication in Apache, check out the Apache docs here: https://httpd.apache.org/docs/current/howto/auth.html[^]. 72 | ==== 73 | -------------------------------------------------------------------------------- /book/06-github/callouts/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/1.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/1.png -------------------------------------------------------------------------------- /book/06-github/callouts/10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/10.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/10.png -------------------------------------------------------------------------------- /book/06-github/callouts/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/2.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/2.png -------------------------------------------------------------------------------- /book/06-github/callouts/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/3.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/3.png -------------------------------------------------------------------------------- /book/06-github/callouts/4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/4.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/4.png -------------------------------------------------------------------------------- /book/06-github/callouts/5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/5.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/5.png -------------------------------------------------------------------------------- /book/06-github/callouts/6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/6.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/6.png -------------------------------------------------------------------------------- /book/06-github/callouts/7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/7.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/7.png -------------------------------------------------------------------------------- /book/06-github/callouts/8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/8.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/8.png -------------------------------------------------------------------------------- /book/06-github/callouts/9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/9.pdf -------------------------------------------------------------------------------- /book/06-github/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/06-github/callouts/9.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/1.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/1.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/10.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/10.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/2.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/2.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/3.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/3.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/4.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/4.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/5.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/5.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/6.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/6.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/7.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/7.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/8.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/8.png -------------------------------------------------------------------------------- /book/07-git-tools/callouts/9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/9.pdf -------------------------------------------------------------------------------- /book/07-git-tools/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/07-git-tools/callouts/9.png -------------------------------------------------------------------------------- /book/07-git-tools/git-credential-read-only: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'optparse' 4 | 5 | path = File.expand_path '~/.git-credentials' # <1> 6 | OptionParser.new do |opts| 7 | opts.banner = 'USAGE: git-credential-read-only [options] ' 8 | opts.on('-f', '--file PATH', 'Specify path for backing store') do |argpath| 9 | path = File.expand_path argpath 10 | end 11 | end.parse! 12 | 13 | exit(0) unless ARGV[0].downcase == 'get' # <2> 14 | exit(0) unless File.exist? path 15 | 16 | known = {} # <3> 17 | while line = STDIN.gets 18 | break if line.strip == '' 19 | k,v = line.strip.split '=', 2 20 | known[k] = v 21 | end 22 | 23 | File.readlines(path).each do |fileline| # <4> 24 | prot,user,pass,host = fileline.scan(/^(.*?):\/\/(.*?):(.*?)@(.*)$/).first 25 | if prot == known['protocol'] and host == known['host'] and user == known['username'] then 26 | puts "protocol=#{prot}" 27 | puts "host=#{host}" 28 | puts "username=#{user}" 29 | puts "password=#{pass}" 30 | exit(0) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /book/09-git-and-other-scms/sections/import-p4.asc: -------------------------------------------------------------------------------- 1 | [[_perforce_import]] 2 | ==== Perforce 3 | 4 | (((Perforce)))(((Importing, from Perforce))) 5 | The next system you'll look at importing from is Perforce. 6 | As we discussed above, there are two ways to let Git and Perforce talk to each other: git-p4 and Perforce Git Fusion. 7 | 8 | ===== Perforce Git Fusion 9 | 10 | Git Fusion makes this process fairly painless. 11 | Just configure your project settings, user mappings, and branches using a configuration file (as discussed in <<_p4_git_fusion>>), and clone the repository. 12 | Git Fusion leaves you with what looks like a native Git repository, which is then ready to push to a native Git host if you desire. 13 | You could even use Perforce as your Git host if you like. 14 | 15 | [[_git_p4]] 16 | ===== Git-p4 17 | 18 | Git-p4 can also act as an import tool. 19 | As an example, we'll import the Jam project from the Perforce Public Depot. 20 | To set up your client, you must export the P4PORT environment variable to point to the Perforce depot: 21 | 22 | [source,console] 23 | ---- 24 | $ export P4PORT=public.perforce.com:1666 25 | ---- 26 | 27 | [NOTE] 28 | ==== 29 | In order to follow along, you'll need a Perforce depot to connect with. 30 | We'll be using the public depot at public.perforce.com for our examples, but you can use any depot you have access to. 31 | ==== 32 | 33 | (((git commands, p4))) 34 | Run the `git p4 clone` command to import the Jam project from the Perforce server, supplying the depot and project path and the path into which you want to import the project: 35 | 36 | [source,console] 37 | ---- 38 | $ git-p4 clone //guest/perforce_software/jam@all p4import 39 | Importing from //guest/perforce_software/jam@all into p4import 40 | Initialized empty Git repository in /private/tmp/p4import/.git/ 41 | Import destination: refs/remotes/p4/master 42 | Importing revision 9957 (100%) 43 | ---- 44 | 45 | This particular project has only one branch, but if you have branches that are configured with branch views (or just a set of directories), you can use the `--detect-branches` flag to `git p4 clone` to import all the project's branches as well. 46 | See <<_git_p4_branches>> for a bit more detail on this. 47 | 48 | At this point you're almost done. 49 | If you go to the `p4import` directory and run `git log`, you can see your imported work: 50 | 51 | [source,console] 52 | ---- 53 | $ git log -2 54 | commit e5da1c909e5db3036475419f6379f2c73710c4e6 55 | Author: giles 56 | Date: Wed Feb 8 03:13:27 2012 -0800 57 | 58 | Correction to line 355; change to . 59 | 60 | [git-p4: depot-paths = "//public/jam/src/": change = 8068] 61 | 62 | commit aa21359a0a135dda85c50a7f7cf249e4f7b8fd98 63 | Author: kwirth 64 | Date: Tue Jul 7 01:35:51 2009 -0800 65 | 66 | Fix spelling error on Jam doc page (cummulative -> cumulative). 67 | 68 | [git-p4: depot-paths = "//public/jam/src/": change = 7304] 69 | ---- 70 | 71 | You can see that `git-p4` has left an identifier in each commit message. 72 | It's fine to keep that identifier there, in case you need to reference the Perforce change number later. 73 | However, if you'd like to remove the identifier, now is the time to do so – before you start doing work on the new repository. 74 | (((git commands, filter-branch))) 75 | You can use `git filter-branch` to remove the identifier strings en masse: 76 | 77 | [source,console] 78 | ---- 79 | $ git filter-branch --msg-filter 'sed -e "/^\[git-p4:/d"' 80 | Rewrite e5da1c909e5db3036475419f6379f2c73710c4e6 (125/125) 81 | Ref 'refs/heads/master' was rewritten 82 | ---- 83 | 84 | If you run `git log`, you can see that all the SHA-1 checksums for the commits have changed, but the `git-p4` strings are no longer in the commit messages: 85 | 86 | [source,console] 87 | ---- 88 | $ git log -2 89 | commit b17341801ed838d97f7800a54a6f9b95750839b7 90 | Author: giles 91 | Date: Wed Feb 8 03:13:27 2012 -0800 92 | 93 | Correction to line 355; change to . 94 | 95 | commit 3e68c2e26cd89cb983eb52c024ecdfba1d6b3fff 96 | Author: kwirth 97 | Date: Tue Jul 7 01:35:51 2009 -0800 98 | 99 | Fix spelling error on Jam doc page (cummulative -> cumulative). 100 | ---- 101 | 102 | Your import is ready to push up to your new Git server. 103 | -------------------------------------------------------------------------------- /book/10-git-internals/sections/plumbing-porcelain.asc: -------------------------------------------------------------------------------- 1 | [[_plumbing_porcelain]] 2 | === Plumbing and Porcelain 3 | 4 | This book covers primarily how to use Git with 30 or so subcommands such as `checkout`, `branch`, `remote`, and so on. 5 | But because Git was initially a toolkit for a version control system rather than a full user-friendly VCS, it has a number of subcommands that do low-level work and were designed to be chained together UNIX-style or called from scripts. 6 | These commands are generally referred to as Git's "`plumbing`" commands, while the more user-friendly commands are called "`porcelain`" commands. 7 | 8 | As you will have noticed by now, this book's first nine chapters deal almost exclusively with porcelain commands. 9 | But in this chapter, you'll be dealing mostly with the lower-level plumbing commands, because they give you access to the inner workings of Git, and help demonstrate how and why Git does what it does. 10 | Many of these commands aren't meant to be used manually on the command line, but rather to be used as building blocks for new tools and custom scripts. 11 | 12 | When you run `git init` in a new or existing directory, Git creates the `.git` directory, which is where almost everything that Git stores and manipulates is located. 13 | If you want to back up or clone your repository, copying this single directory elsewhere gives you nearly everything you need. 14 | This entire chapter basically deals with what you can see in this directory. 15 | Here's what a newly-initialized `.git` directory typically looks like: 16 | 17 | [source,console] 18 | ---- 19 | $ ls -F1 20 | config 21 | description 22 | HEAD 23 | hooks/ 24 | info/ 25 | objects/ 26 | refs/ 27 | ---- 28 | 29 | Depending on your version of Git, you may see some additional content there, but this is a fresh `git init` repository -- it's what you see by default. 30 | The `description` file is used only by the GitWeb program, so don't worry about it. 31 | The `config` file contains your project-specific configuration options, and the `info` directory keeps a global exclude file (((excludes))) for ignored patterns that you don't want to track in a `.gitignore` file. 32 | The `hooks` directory contains your client- or server-side hook scripts, which are discussed in detail in <>. 33 | 34 | This leaves four important entries: the `HEAD` and (yet to be created) `index` files, and the `objects` and `refs` directories. 35 | These are the core parts of Git. 36 | The `objects` directory stores all the content for your database, the `refs` directory stores pointers into commit objects in that data (branches, tags, remotes and more), the `HEAD` file points to the branch you currently have checked out, and the `index` file is where Git stores your staging area information. 37 | You'll now look at each of these sections in detail to see how Git operates. 38 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/bash.asc: -------------------------------------------------------------------------------- 1 | === Git in Bash 2 | 3 | (((bash)))(((tab completion, bash)))(((shell prompts, bash))) 4 | If you're a Bash user, you can tap into some of your shell's features to make your experience with Git a lot friendlier. 5 | Git actually ships with plugins for several shells, but it's not turned on by default. 6 | 7 | First, you need to get a copy of the completions file from the source code of the Git release you're using. 8 | Check your version by typing `git version`, then use `git checkout tags/vX.Y.Z`, where `vX.Y.Z` corresponds to the version of Git you are using. 9 | Copy the `contrib/completion/git-completion.bash` file somewhere handy, like your home directory, and add this to your `.bashrc`: 10 | 11 | [source,console] 12 | ---- 13 | . ~/git-completion.bash 14 | ---- 15 | 16 | Once that's done, change your directory to a Git repository, and type: 17 | 18 | [source,console] 19 | ---- 20 | $ git chec 21 | ---- 22 | 23 | …and Bash will auto-complete to `git checkout`. 24 | This works with all of Git's subcommands, command-line parameters, and remotes and ref names where appropriate. 25 | 26 | It's also useful to customize your prompt to show information about the current directory's Git repository. 27 | This can be as simple or complex as you want, but there are generally a few key pieces of information that most people want, like the current branch, and the status of the working directory. 28 | To add these to your prompt, just copy the `contrib/completion/git-prompt.sh` file from Git's source repository to your home directory, add something like this to your `.bashrc`: 29 | 30 | [source,console] 31 | ---- 32 | . ~/git-prompt.sh 33 | export GIT_PS1_SHOWDIRTYSTATE=1 34 | export PS1='\w$(__git_ps1 " (%s)")\$ ' 35 | ---- 36 | 37 | The `\w` means print the current working directory, the `\$` prints the `$` part of the prompt, and `__git_ps1 " (%s)"` calls the function provided by `git-prompt.sh` with a formatting argument. 38 | Now your bash prompt will look like this when you're anywhere inside a Git-controlled project: 39 | 40 | .Customized `bash` prompt 41 | image::images/git-bash.png[Customized `bash` prompt] 42 | 43 | Both of these scripts come with helpful documentation; take a look at the contents of `git-completion.bash` and `git-prompt.sh` for more information. 44 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/jetbrainsides.asc: -------------------------------------------------------------------------------- 1 | === Git in IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine 2 | 3 | JetBrains IDEs (such as IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, RubyMine, and others) ship with a Git Integration plugin. 4 | It provides a dedicated view in the IDE to work with Git and GitHub Pull Requests. 5 | 6 | .Version Control ToolWindow in JetBrains IDEs 7 | image::images/jb.png[Version Control ToolWindow in JetBrains IDEs] 8 | 9 | The integration relies on the command-line Git client, and requires one to be installed. 10 | The official documentation is available at https://www.jetbrains.com/help/idea/using-git-integration.html[^]. 11 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/sublimetext.asc: -------------------------------------------------------------------------------- 1 | === Git in Sublime Text 2 | 3 | From version 3.2 onwards, Sublime Text has Git integration in the editor. 4 | 5 | The features are: 6 | 7 | * The sidebar will show the `git status` of files and folders with a badge/icon. 8 | * Files and folders that are in your `.gitignore` file will be faded out in the sidebar. 9 | * In the status bar, you can see the current Git branch and how many modifications you have made. 10 | * All changes to a file are now visible via markers in the gutter. 11 | * You can use part of the Sublime Merge Git client functionality from within Sublime Text. 12 | This requires that Sublime Merge is installed. 13 | See: https://www.sublimemerge.com/[^]. 14 | 15 | The official documentation for Sublime Text can be found here: https://www.sublimetext.com/docs/git_integration.html[^]. 16 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/visualstudio.asc: -------------------------------------------------------------------------------- 1 | === Git in Visual Studio 2 | 3 | (((Visual Studio))) 4 | Visual Studio has Git tooling built directly into the IDE, starting with Visual Studio 2019 version 16.8. 5 | 6 | The tooling supports the following Git functionality: 7 | 8 | * Create or clone a repository. 9 | * Open and browse history of a repository. 10 | * Create and checkout branches and tags. 11 | * Stash, stage, and commit changes. 12 | * Fetch, pull, push, or sync commits. 13 | * Merge and rebase branches. 14 | * Resolve merge conflicts. 15 | * View diffs. 16 | * ... and more! 17 | 18 | Read the https://learn.microsoft.com/en-us/visualstudio/version-control/[official documentation^] to learn more. 19 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/visualstudiocode.asc: -------------------------------------------------------------------------------- 1 | === Git in Visual Studio Code 2 | 3 | Visual Studio Code has Git support built in. 4 | You will need to have Git version 2.0.0 (or newer) installed. 5 | 6 | The main features are: 7 | 8 | * See the diff of the file you are editing in the gutter. 9 | * The Git Status Bar (lower left) shows the current branch, dirty indicators, incoming and outgoing commits. 10 | * You can do the most common git operations from within the editor: 11 | ** Initialize a repository. 12 | ** Clone a repository. 13 | ** Create branches and tags. 14 | ** Stage and commit changes. 15 | ** Push/pull/sync with a remote branch. 16 | ** Resolve merge conflicts. 17 | ** View diffs. 18 | * With an extension, you can also handle GitHub Pull Requests: 19 | https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github[^]. 20 | 21 | The official documentation can be found here: https://code.visualstudio.com/docs/sourcecontrol/overview[^]. 22 | -------------------------------------------------------------------------------- /book/A-git-in-other-environments/sections/zsh.asc: -------------------------------------------------------------------------------- 1 | === Git in Zsh 2 | 3 | (((zsh)))(((tab completion, zsh)))(((shell prompts, zsh))) 4 | Zsh also ships with a tab-completion library for Git. 5 | To use it, simply run `autoload -Uz compinit && compinit` in your `.zshrc`. 6 | Zsh's interface is a bit more powerful than Bash's: 7 | 8 | [source,console] 9 | ---- 10 | $ git che 11 | check-attr -- display gitattributes information 12 | check-ref-format -- ensure that a reference name is well formed 13 | checkout -- checkout branch or paths to working tree 14 | checkout-index -- copy files from index to working directory 15 | cherry -- find commits not merged upstream 16 | cherry-pick -- apply changes introduced by some existing commits 17 | ---- 18 | 19 | Ambiguous tab-completions aren't just listed; they have helpful descriptions, and you can graphically navigate the list by repeatedly hitting tab. 20 | This works with Git commands, their arguments, and names of things inside the repository (like refs and remotes), as well as filenames and all the other things Zsh knows how to tab-complete. 21 | 22 | Zsh ships with a framework for getting information from version control systems, called `vcs_info`. 23 | To include the branch name in the prompt on the right side, add these lines to your `~/.zshrc` file: 24 | 25 | [source,console] 26 | ---- 27 | autoload -Uz vcs_info 28 | precmd_vcs_info() { vcs_info } 29 | precmd_functions+=( precmd_vcs_info ) 30 | setopt prompt_subst 31 | RPROMPT='${vcs_info_msg_0_}' 32 | # PROMPT='${vcs_info_msg_0_}%# ' 33 | zstyle ':vcs_info:git:*' formats '%b' 34 | ---- 35 | 36 | This results in a display of the current branch on the right-hand side of the terminal window, whenever your shell is inside a Git repository. 37 | The left side is supported as well, of course; just uncomment the assignment to `PROMPT`. 38 | It looks a bit like this: 39 | 40 | .Customized `zsh` prompt 41 | image::images/zsh-prompt.png[Customized `zsh` prompt] 42 | 43 | For more information on `vcs_info`, check out its documentation in the `zshcontrib(1)` manual page, or online at https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#Version-Control-Information[^]. 44 | 45 | Instead of `vcs_info`, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh[^] for details. 46 | `git-prompt.sh` is compatible with both Bash and Zsh. 47 | 48 | Zsh is powerful enough that there are entire frameworks dedicated to making it better. 49 | One of them is called "oh-my-zsh", and it can be found at https://github.com/ohmyzsh/ohmyzsh[^]. 50 | oh-my-zsh's plugin system comes with powerful Git tab-completion, and it has a variety of prompt "themes", many of which display version-control data. 51 | <> is just one example of what can be done with this system. 52 | 53 | [[oh_my_zsh_git]] 54 | .An example of an oh-my-zsh theme 55 | image::images/zsh-oh-my.png[An example of an oh-my-zsh theme] 56 | -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/1.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/1.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/10.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/10.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/2.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/2.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/3.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/3.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/4.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/4.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/5.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/5.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/6.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/6.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/7.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/7.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/8.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/8.png -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/9.pdf -------------------------------------------------------------------------------- /book/B-embedding-git/callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/B-embedding-git/callouts/9.png -------------------------------------------------------------------------------- /book/B-embedding-git/sections/command-line.asc: -------------------------------------------------------------------------------- 1 | === Command-line Git 2 | 3 | One option is to spawn a shell process and use the Git command-line tool to do the work. 4 | This has the benefit of being canonical, and all of Git's features are supported. 5 | This also happens to be fairly easy, as most runtime environments have a relatively simple facility for invoking a process with command-line arguments. 6 | However, this approach does have some downsides. 7 | 8 | One is that all the output is in plain text. 9 | This means that you'll have to parse Git's occasionally-changing output format to read progress and result information, which can be inefficient and error-prone. 10 | 11 | Another is the lack of error recovery. 12 | If a repository is corrupted somehow, or the user has a malformed configuration value, Git will simply refuse to perform many operations. 13 | 14 | Yet another is process management. 15 | Git requires you to maintain a shell environment on a separate process, which can add unwanted complexity. 16 | Trying to coordinate many of these processes (especially when potentially accessing the same repository from several processes) can be quite a challenge. 17 | -------------------------------------------------------------------------------- /book/B-embedding-git/sections/dulwich.asc: -------------------------------------------------------------------------------- 1 | === Dulwich 2 | 3 | (((Dulwich)))(((Python))) 4 | There is also a pure-Python Git implementation - Dulwich. 5 | The project is hosted under https://www.dulwich.io/[^]. 6 | It aims to provide an interface to Git repositories (both local and remote) that doesn't call out to Git directly but instead uses pure Python. 7 | It has an optional C extensions though, that significantly improve the performance. 8 | 9 | Dulwich follows Git design and separate two basic levels of API: plumbing and porcelain. 10 | 11 | Here is an example of using the lower level API to access the commit message of the last commit: 12 | 13 | [source, python] 14 | ---- 15 | from dulwich.repo import Repo 16 | r = Repo('.') 17 | r.head() 18 | # '57fbe010446356833a6ad1600059d80b1e731e15' 19 | 20 | c = r[r.head()] 21 | c 22 | # 23 | 24 | c.message 25 | # 'Add note about encoding.\n' 26 | ---- 27 | 28 | To print a commit log using high-level porcelain API, one can use: 29 | 30 | [source, python] 31 | ---- 32 | from dulwich import porcelain 33 | porcelain.log('.', max_entries=1) 34 | 35 | #commit: 57fbe010446356833a6ad1600059d80b1e731e15 36 | #Author: Jelmer Vernooij 37 | #Date: Sat Apr 29 2017 23:57:34 +0000 38 | ---- 39 | 40 | ==== Further Reading 41 | 42 | The API documentation, tutorial, and many examples of how to do specific tasks with Dulwich are available on the official website https://www.dulwich.io[^]. 43 | -------------------------------------------------------------------------------- /book/B-embedding-git/sections/go-git.asc: -------------------------------------------------------------------------------- 1 | === go-git 2 | 3 | (((go-git)))(((Go))) 4 | In case you want to integrate Git into a service written in Golang, there also is a pure Go library implementation. 5 | This implementation does not have any native dependencies and thus is not prone to manual memory management errors. 6 | It is also transparent for the standard Golang performance analysis tooling like CPU, Memory profilers, race detector, etc. 7 | 8 | go-git is focused on extensibility, compatibility and supports most of the plumbing APIs, which is documented at https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md[^]. 9 | 10 | Here is a basic example of using Go APIs: 11 | 12 | [source, go] 13 | ---- 14 | import "github.com/go-git/go-git/v5" 15 | 16 | r, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{ 17 | URL: "https://github.com/go-git/go-git", 18 | Progress: os.Stdout, 19 | }) 20 | ---- 21 | 22 | As soon as you have a `Repository` instance, you can access information and perform mutations on it: 23 | 24 | [source, go] 25 | ---- 26 | // retrieves the branch pointed by HEAD 27 | ref, err := r.Head() 28 | 29 | // get the commit object, pointed by ref 30 | commit, err := r.CommitObject(ref.Hash()) 31 | 32 | // retrieves the commit history 33 | history, err := commit.History() 34 | 35 | // iterates over the commits and print each 36 | for _, c := range history { 37 | fmt.Println(c) 38 | } 39 | ---- 40 | 41 | ==== Advanced Functionality 42 | 43 | go-git has few notable advanced features, one of which is a pluggable storage system, which is similar to Libgit2 backends. 44 | The default implementation is in-memory storage, which is very fast. 45 | 46 | [source, go] 47 | ---- 48 | r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ 49 | URL: "https://github.com/go-git/go-git", 50 | }) 51 | ---- 52 | 53 | Pluggable storage provides many interesting options. 54 | For instance, https://github.com/go-git/go-git/tree/master/_examples/storage[^] allows you to store references, objects, and configuration in an Aerospike database. 55 | 56 | Another feature is a flexible filesystem abstraction. 57 | Using https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem[^] it is easy to store all the files in different way i.e by packing all of them to a single archive on disk or by keeping them all in-memory. 58 | 59 | Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[^]. 60 | 61 | [source, go] 62 | ---- 63 | customClient := &http.Client{ 64 | Transport: &http.Transport{ // accept any certificate (might be useful for testing) 65 | TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, 66 | }, 67 | Timeout: 15 * time.Second, // 15 second timeout 68 | CheckRedirect: func(req *http.Request, via []*http.Request) error { 69 | return http.ErrUseLastResponse // don't follow redirect 70 | }, 71 | } 72 | 73 | // Override http(s) default protocol to use our custom client 74 | client.InstallProtocol("https", githttp.NewClient(customClient)) 75 | 76 | // Clone repository using the new client if the protocol is https:// 77 | r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: url}) 78 | ---- 79 | 80 | ==== Further Reading 81 | 82 | A full treatment of go-git's capabilities is outside the scope of this book. 83 | If you want more information on go-git, there's API documentation at https://pkg.go.dev/github.com/go-git/go-git/v5[^], and a set of usage examples at https://github.com/go-git/go-git/tree/master/_examples[^]. 84 | -------------------------------------------------------------------------------- /book/contributors.asc: -------------------------------------------------------------------------------- 1 | [preface] 2 | == Contributors 3 | 4 | Since this is an Open Source book, we have gotten several errata and content changes donated over the years. 5 | Here are all the people who have contributed to the English version of Pro Git as an open source project. 6 | Thank you everyone for helping make this a better book for everyone. 7 | 8 | [source,tabsize=8] 9 | ---- 10 | include::contributors.txt[] 11 | ---- 12 | -------------------------------------------------------------------------------- /book/cover.html: -------------------------------------------------------------------------------- 1 |
cover
2 | -------------------------------------------------------------------------------- /book/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/book/cover.png -------------------------------------------------------------------------------- /book/dedication.asc: -------------------------------------------------------------------------------- 1 | [dedication] 2 | == Dedications 3 | 4 | _To my wife, Becky, without whom this adventure never would have begun. — Ben_ 5 | 6 | _This edition is dedicated to my girls. 7 | To my wife Jessica who has supported me for all of these years and to my daughter Josephine, who will support me when I'm too old to know what's going on. — Scott_ 8 | -------------------------------------------------------------------------------- /book/license.asc: -------------------------------------------------------------------------------- 1 | [preface] 2 | == License 3 | 4 | include::../LICENSE.asc[] 5 | -------------------------------------------------------------------------------- /book/preface_ben.asc: -------------------------------------------------------------------------------- 1 | [preface] 2 | == Preface by Ben Straub 3 | 4 | The first edition of this book is what got me hooked on Git. 5 | This was my introduction to a style of making software that felt more natural than anything I had seen before. 6 | I had been a developer for several years by then, but this was the right turn that sent me down a much more interesting path than the one I was on. 7 | 8 | Now, years later, I'm a contributor to a major Git implementation, I've worked for the largest Git hosting company, and I've traveled the world teaching people about Git. 9 | When Scott asked if I'd be interested in working on the second edition, I didn't even have to think. 10 | 11 | It's been a great pleasure and privilege to work on this book. 12 | I hope it helps you as much as it did me. 13 | -------------------------------------------------------------------------------- /book/preface_schacon.asc: -------------------------------------------------------------------------------- 1 | [preface] 2 | == Preface by Scott Chacon 3 | 4 | Welcome to the second edition of Pro Git. 5 | The first edition was published over four years ago now. 6 | Since then a lot has changed and yet many important things have not. 7 | While most of the core commands and concepts are still valid today as the Git core team is pretty fantastic at keeping things backward compatible, there have been some significant additions and changes in the community surrounding Git. 8 | The second edition of this book is meant to address those changes and update the book so it can be more helpful to the new user. 9 | 10 | When I wrote the first edition, Git was still a relatively difficult to use and barely adopted tool for the harder core hacker. 11 | It was starting to gain steam in certain communities, but had not reached anywhere near the ubiquity it has today. 12 | Since then, nearly every open source community has adopted it. 13 | Git has made incredible progress on Windows, in the explosion of graphical user interfaces to it for all platforms, in IDE support and in business use. 14 | The Pro Git of four years ago knows about none of that. 15 | One of the main aims of this new edition is to touch on all of those new frontiers in the Git community. 16 | 17 | The Open Source community using Git has also exploded. 18 | When I originally sat down to write the book nearly five years ago (it took me a while to get the first version out), I had just started working at a very little known company developing a Git hosting website called GitHub. 19 | At the time of publishing there were maybe a few thousand people using the site and just four of us working on it. 20 | As I write this introduction, GitHub is announcing our 10 millionth hosted project, with nearly 5 million registered developer accounts and over 230 employees. 21 | Love it or hate it, GitHub has heavily changed large swaths of the Open Source community in a way that was barely conceivable when I sat down to write the first edition. 22 | 23 | I wrote a small section in the original version of Pro Git about GitHub as an example of hosted Git which I was never very comfortable with. 24 | I didn't much like that I was writing what I felt was essentially a community resource and also talking about my company in it. 25 | While I still don't love that conflict of interests, the importance of GitHub in the Git community is unavoidable. 26 | Instead of an example of Git hosting, I have decided to turn that part of the book into more deeply describing what GitHub is and how to effectively use it. 27 | If you are going to learn how to use Git then knowing how to use GitHub will help you take part in a huge community, which is valuable no matter which Git host you decide to use for your own code. 28 | 29 | The other large change in the time since the last publishing has been the development and rise of the HTTP protocol for Git network transactions. 30 | Most of the examples in the book have been changed to HTTP from SSH because it's so much simpler. 31 | 32 | It's been amazing to watch Git grow over the past few years from a relatively obscure version control system to basically dominating commercial and open source version control. 33 | I'm happy that Pro Git has done so well and has also been able to be one of the few technical books on the market that is both quite successful and fully open source. 34 | 35 | I hope you enjoy this updated edition of Pro Git. 36 | -------------------------------------------------------------------------------- /book/toc.asc: -------------------------------------------------------------------------------- 1 | {{ toc }} 2 | -------------------------------------------------------------------------------- /callouts/1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/1.pdf -------------------------------------------------------------------------------- /callouts/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/1.png -------------------------------------------------------------------------------- /callouts/10.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/10.pdf -------------------------------------------------------------------------------- /callouts/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/10.png -------------------------------------------------------------------------------- /callouts/2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/2.pdf -------------------------------------------------------------------------------- /callouts/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/2.png -------------------------------------------------------------------------------- /callouts/3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/3.pdf -------------------------------------------------------------------------------- /callouts/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/3.png -------------------------------------------------------------------------------- /callouts/4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/4.pdf -------------------------------------------------------------------------------- /callouts/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/4.png -------------------------------------------------------------------------------- /callouts/5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/5.pdf -------------------------------------------------------------------------------- /callouts/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/5.png -------------------------------------------------------------------------------- /callouts/6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/6.pdf -------------------------------------------------------------------------------- /callouts/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/6.png -------------------------------------------------------------------------------- /callouts/7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/7.pdf -------------------------------------------------------------------------------- /callouts/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/7.png -------------------------------------------------------------------------------- /callouts/8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/8.pdf -------------------------------------------------------------------------------- /callouts/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/8.png -------------------------------------------------------------------------------- /callouts/9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/9.pdf -------------------------------------------------------------------------------- /callouts/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/callouts/9.png -------------------------------------------------------------------------------- /ch01-getting-started.asc: -------------------------------------------------------------------------------- 1 | [[ch01-getting-started]] 2 | == Getting Started 3 | 4 | This chapter will be about getting started with Git. 5 | We will begin by explaining some background on version control tools, then move on to how to get Git running on your system and finally how to get it set up to start working with. 6 | At the end of this chapter you should understand why Git is around, why you should use it and you should be all set up to do so. 7 | 8 | include::book/01-introduction/sections/about-version-control.asc[] 9 | 10 | include::book/01-introduction/sections/history.asc[] 11 | 12 | include::book/01-introduction/sections/what-is-git.asc[] 13 | 14 | include::book/01-introduction/sections/command-line.asc[] 15 | 16 | include::book/01-introduction/sections/installing.asc[] 17 | 18 | include::book/01-introduction/sections/first-time-setup.asc[] 19 | 20 | include::book/01-introduction/sections/help.asc[] 21 | 22 | === Summary 23 | 24 | You should have a basic understanding of what Git is and how it's different from any centralized version control systems you may have been using previously. 25 | You should also now have a working version of Git on your system that's set up with your personal identity. 26 | It's now time to learn some Git basics. 27 | -------------------------------------------------------------------------------- /ch02-git-basics-chapter.asc: -------------------------------------------------------------------------------- 1 | [[ch02-git-basics-chapter]] 2 | == Git Basics 3 | 4 | If you can read only one chapter to get going with Git, this is it. 5 | This chapter covers every basic command you need to do the vast majority of the things you'll eventually spend your time doing with Git. 6 | By the end of the chapter, you should be able to configure and initialize a repository, begin and stop tracking files, and stage and commit changes. 7 | We'll also show you how to set up Git to ignore certain files and file patterns, how to undo mistakes quickly and easily, how to browse the history of your project and view changes between commits, and how to push and pull from remote repositories. 8 | 9 | include::book/02-git-basics/sections/getting-a-repository.asc[] 10 | 11 | include::book/02-git-basics/sections/recording-changes.asc[] 12 | 13 | include::book/02-git-basics/sections/viewing-history.asc[] 14 | 15 | include::book/02-git-basics/sections/undoing.asc[] 16 | 17 | include::book/02-git-basics/sections/remotes.asc[] 18 | 19 | include::book/02-git-basics/sections/tagging.asc[] 20 | 21 | include::book/02-git-basics/sections/aliases.asc[] 22 | 23 | === Summary 24 | 25 | At this point, you can do all the basic local Git operations -- creating or cloning a repository, making changes, staging and committing those changes, and viewing the history of all the changes the repository has been through. 26 | Next, we'll cover Git's killer feature: its branching model. 27 | -------------------------------------------------------------------------------- /ch03-git-branching.asc: -------------------------------------------------------------------------------- 1 | [[ch03-git-branching]] 2 | == Git Branching 3 | 4 | (((branches))) 5 | Nearly every VCS has some form of branching support. 6 | Branching means you diverge from the main line of development and continue to do work without messing with that main line. 7 | In many VCS tools, this is a somewhat expensive process, often requiring you to create a new copy of your source code directory, which can take a long time for large projects. 8 | 9 | Some people refer to Git's branching model as its "`killer feature,`" and it certainly sets Git apart in the VCS community. 10 | Why is it so special? 11 | The way Git branches is incredibly lightweight, making branching operations nearly instantaneous, and switching back and forth between branches generally just as fast. 12 | Unlike many other VCSs, Git encourages workflows that branch and merge often, even multiple times in a day. 13 | Understanding and mastering this feature gives you a powerful and unique tool and can entirely change the way that you develop. 14 | 15 | include::book/03-git-branching/sections/nutshell.asc[] 16 | 17 | include::book/03-git-branching/sections/basic-branching-and-merging.asc[] 18 | 19 | include::book/03-git-branching/sections/branch-management.asc[] 20 | 21 | include::book/03-git-branching/sections/workflows.asc[] 22 | 23 | include::book/03-git-branching/sections/remote-branches.asc[] 24 | 25 | include::book/03-git-branching/sections/rebasing.asc[] 26 | 27 | === Summary 28 | 29 | We've covered basic branching and merging in Git. 30 | You should feel comfortable creating and switching to new branches, switching between branches and merging local branches together. 31 | You should also be able to share your branches by pushing them to a shared server, working with others on shared branches and rebasing your branches before they are shared. 32 | Next, we'll cover what you'll need to run your own Git repository-hosting server. 33 | -------------------------------------------------------------------------------- /ch04-git-on-the-server.asc: -------------------------------------------------------------------------------- 1 | [[ch04-git-on-the-server]] 2 | == Git on the Server 3 | 4 | (((serving repositories))) 5 | At this point, you should be able to do most of the day-to-day tasks for which you'll be using Git. 6 | However, in order to do any collaboration in Git, you'll need to have a remote Git repository. 7 | Although you can technically push changes to and pull changes from individuals' repositories, doing so is discouraged because you can fairly easily confuse what they're working on if you're not careful. 8 | Furthermore, you want your collaborators to be able to access the repository even if your computer is offline -- having a more reliable common repository is often useful. 9 | Therefore, the preferred method for collaborating with someone is to set up an intermediate repository that you both have access to, and push to and pull from that. 10 | 11 | Running a Git server is fairly straightforward. 12 | First, you choose which protocols you want your server to support. 13 | The first section of this chapter will cover the available protocols and the pros and cons of each. 14 | The next sections will explain some typical setups using those protocols and how to get your server running with them. 15 | Last, we'll go over a few hosted options, if you don't mind hosting your code on someone else's server and don't want to go through the hassle of setting up and maintaining your own server. 16 | 17 | If you have no interest in running your own server, you can skip to the last section of the chapter to see some options for setting up a hosted account and then move on to the next chapter, where we discuss the various ins and outs of working in a distributed source control environment. 18 | 19 | A remote repository is generally a _bare repository_ -- a Git repository that has no working directory. 20 | Because the repository is only used as a collaboration point, there is no reason to have a snapshot checked out on disk; it's just the Git data. 21 | In the simplest terms, a bare repository is the contents of your project's `.git` directory and nothing else. 22 | 23 | include::book/04-git-server/sections/protocols.asc[] 24 | 25 | include::book/04-git-server/sections/git-on-a-server.asc[] 26 | 27 | include::book/04-git-server/sections/generating-ssh-key.asc[] 28 | 29 | include::book/04-git-server/sections/setting-up-server.asc[] 30 | 31 | include::book/04-git-server/sections/git-daemon.asc[] 32 | 33 | include::book/04-git-server/sections/smart-http.asc[] 34 | 35 | include::book/04-git-server/sections/gitweb.asc[] 36 | 37 | include::book/04-git-server/sections/gitlab.asc[] 38 | 39 | include::book/04-git-server/sections/hosted.asc[] 40 | 41 | === Summary 42 | 43 | You have several options to get a remote Git repository up and running so that you can collaborate with others or share your work. 44 | 45 | Running your own server gives you a lot of control and allows you to run the server within your own firewall, but such a server generally requires a fair amount of your time to set up and maintain. 46 | If you place your data on a hosted server, it's easy to set up and maintain; however, you have to be able to keep your code on someone else's servers, and some organizations don't allow that. 47 | 48 | It should be fairly straightforward to determine which solution or combination of solutions is appropriate for you and your organization. 49 | -------------------------------------------------------------------------------- /ch05-distributed-git.asc: -------------------------------------------------------------------------------- 1 | [[ch05-distributed-git]] 2 | == Distributed Git 3 | 4 | (((distributed git))) 5 | Now that you have a remote Git repository set up as a focal point for all the developers to share their code, and you're familiar with basic Git commands in a local workflow, you'll look at how to utilize some of the distributed workflows that Git affords you. 6 | 7 | In this chapter, you'll see how to work with Git in a distributed environment as a contributor and an integrator. 8 | That is, you'll learn how to contribute code successfully to a project and make it as easy on you and the project maintainer as possible, and also how to maintain a project successfully with a number of developers contributing. 9 | 10 | include::book/05-distributed-git/sections/distributed-workflows.asc[] 11 | 12 | include::book/05-distributed-git/sections/contributing.asc[] 13 | 14 | include::book/05-distributed-git/sections/maintaining.asc[] 15 | 16 | === Summary 17 | 18 | You should feel fairly comfortable contributing to a project in Git as well as maintaining your own project or integrating other users' contributions. 19 | Congratulations on being an effective Git developer! 20 | In the next chapter, you'll learn about how to use the largest and most popular Git hosting service, GitHub. 21 | -------------------------------------------------------------------------------- /ch06-github.asc: -------------------------------------------------------------------------------- 1 | [[ch06-github]] 2 | == GitHub 3 | 4 | (((GitHub))) 5 | GitHub is the single largest host for Git repositories, and is the central point of collaboration for millions of developers and projects. 6 | A large percentage of all Git repositories are hosted on GitHub, and many open-source projects use it for Git hosting, issue tracking, code review, and other things. 7 | So while it's not a direct part of the Git open source project, there's a good chance that you'll want or need to interact with GitHub at some point while using Git professionally. 8 | 9 | This chapter is about using GitHub effectively. 10 | We'll cover signing up for and managing an account, creating and using Git repositories, common workflows to contribute to projects and to accept contributions to yours, GitHub's programmatic interface and lots of little tips to make your life easier in general. 11 | 12 | If you are not interested in using GitHub to host your own projects or to collaborate with other projects that are hosted on GitHub, you can safely skip to <>. 13 | 14 | [WARNING] 15 | .Interfaces Change 16 | ==== 17 | It's important to note that like many active websites, the UI elements in these screenshots are bound to change over time. 18 | Hopefully the general idea of what we're trying to accomplish here will still be there, but if you want more up to date versions of these screens, the online versions of this book may have newer screenshots. 19 | ==== 20 | 21 | include::book/06-github/sections/1-setting-up-account.asc[] 22 | 23 | include::book/06-github/sections/2-contributing.asc[] 24 | 25 | include::book/06-github/sections/3-maintaining.asc[] 26 | 27 | include::book/06-github/sections/4-managing-organization.asc[] 28 | 29 | include::book/06-github/sections/5-scripting.asc[] 30 | 31 | === Summary 32 | 33 | Now you're a GitHub user. 34 | You know how to create an account, manage an organization, create and push to repositories, contribute to other people's projects and accept contributions from others. 35 | In the next chapter, you'll learn more powerful tools and tips for dealing with complex situations, which will truly make you a Git master. 36 | -------------------------------------------------------------------------------- /ch07-git-tools.asc: -------------------------------------------------------------------------------- 1 | [[ch07-git-tools]] 2 | == Git Tools 3 | 4 | By now, you've learned most of the day-to-day commands and workflows that you need to manage or maintain a Git repository for your source code control. 5 | You've accomplished the basic tasks of tracking and committing files, and you've harnessed the power of the staging area and lightweight topic branching and merging. 6 | 7 | Now you'll explore a number of very powerful things that Git can do that you may not necessarily use on a day-to-day basis but that you may need at some point. 8 | 9 | include::book/07-git-tools/sections/revision-selection.asc[] 10 | 11 | include::book/07-git-tools/sections/interactive-staging.asc[] 12 | 13 | include::book/07-git-tools/sections/stashing-cleaning.asc[] 14 | 15 | include::book/07-git-tools/sections/signing.asc[] 16 | 17 | include::book/07-git-tools/sections/searching.asc[] 18 | 19 | include::book/07-git-tools/sections/rewriting-history.asc[] 20 | 21 | include::book/07-git-tools/sections/reset.asc[] 22 | 23 | include::book/07-git-tools/sections/advanced-merging.asc[] 24 | 25 | include::book/07-git-tools/sections/rerere.asc[] 26 | 27 | include::book/07-git-tools/sections/debugging.asc[] 28 | 29 | include::book/07-git-tools/sections/submodules.asc[] 30 | 31 | include::book/07-git-tools/sections/bundling.asc[] 32 | 33 | include::book/07-git-tools/sections/replace.asc[] 34 | 35 | include::book/07-git-tools/sections/credentials.asc[] 36 | 37 | === Summary 38 | 39 | You've seen a number of advanced tools that allow you to manipulate your commits and staging area more precisely. 40 | When you notice issues, you should be able to easily figure out what commit introduced them, when, and by whom. 41 | If you want to use subprojects in your project, you've learned how to accommodate those needs. 42 | At this point, you should be able to do most of the things in Git that you'll need on the command line day to day and feel comfortable doing so. 43 | -------------------------------------------------------------------------------- /ch08-customizing-git.asc: -------------------------------------------------------------------------------- 1 | [[ch08-customizing-git]] 2 | == Customizing Git 3 | 4 | So far, we've covered the basics of how Git works and how to use it, and we've introduced a number of tools that Git provides to help you use it easily and efficiently. 5 | In this chapter, we'll see how you can make Git operate in a more customized fashion, by introducing several important configuration settings and the hooks system. 6 | With these tools, it's easy to get Git to work exactly the way you, your company, or your group needs it to. 7 | 8 | include::book/08-customizing-git/sections/config.asc[] 9 | 10 | include::book/08-customizing-git/sections/attributes.asc[] 11 | 12 | include::book/08-customizing-git/sections/hooks.asc[] 13 | 14 | include::book/08-customizing-git/sections/policy.asc[] 15 | 16 | === Summary 17 | 18 | We've covered most of the major ways that you can customize your Git client and server to best fit your workflow and projects. 19 | You've learned about all sorts of configuration settings, file-based attributes, and event hooks, and you've built an example policy-enforcing server. 20 | You should now be able to make Git fit nearly any workflow you can dream up. 21 | -------------------------------------------------------------------------------- /ch09-git-and-other-systems.asc: -------------------------------------------------------------------------------- 1 | [[ch09-git-and-other-systems]] 2 | == Git and Other Systems 3 | 4 | The world isn't perfect. 5 | Usually, you can't immediately switch every project you come in contact with to Git. 6 | Sometimes you're stuck on a project using another VCS, and wish it was Git. 7 | We'll spend the first part of this chapter learning about ways to use Git as a client when the project you're working on is hosted in a different system. 8 | 9 | At some point, you may want to convert your existing project to Git. 10 | The second part of this chapter covers how to migrate your project into Git from several specific systems, as well as a method that will work if no pre-built import tool exists. 11 | 12 | === Git as a Client 13 | 14 | (((Git as a client))) 15 | Git provides such a nice experience for developers that many people have figured out how to use it on their workstation, even if the rest of their team is using an entirely different VCS. 16 | There are a number of these adapters, called "`bridges,`" available. 17 | Here we'll cover the ones you're most likely to run into in the wild. 18 | 19 | include::book/09-git-and-other-scms/sections/client-svn.asc[] 20 | 21 | include::book/09-git-and-other-scms/sections/client-hg.asc[] 22 | 23 | include::book/09-git-and-other-scms/sections/client-p4.asc[] 24 | 25 | [[_migrating]] 26 | === Migrating to Git 27 | 28 | (((Migrating to Git))) 29 | If you have an existing codebase in another VCS but you've decided to start using Git, you must migrate your project one way or another. 30 | This section goes over some importers for common systems, and then demonstrates how to develop your own custom importer. 31 | You'll learn how to import data from several of the bigger professionally used SCM systems, because they make up the majority of users who are switching, and because high-quality tools for them are easy to come by. 32 | 33 | include::book/09-git-and-other-scms/sections/import-svn.asc[] 34 | 35 | include::book/09-git-and-other-scms/sections/import-hg.asc[] 36 | 37 | include::book/09-git-and-other-scms/sections/import-p4.asc[] 38 | 39 | include::book/09-git-and-other-scms/sections/import-custom.asc[] 40 | 41 | === Summary 42 | 43 | You should feel comfortable using Git as a client for other version-control systems, or importing nearly any existing repository into Git without losing data. 44 | In the next chapter, we'll cover the raw internals of Git so you can craft every single byte, if need be. 45 | -------------------------------------------------------------------------------- /ch10-git-internals.asc: -------------------------------------------------------------------------------- 1 | [[ch10-git-internals]] 2 | == Git Internals 3 | 4 | You may have skipped to this chapter from a much earlier chapter, or you may have gotten here after sequentially reading the entire book up to this point -- in either case, this is where we'll go over the inner workings and implementation of Git. 5 | We found that understanding this information was fundamentally important to appreciating how useful and powerful Git is, but others have argued to us that it can be confusing and unnecessarily complex for beginners. 6 | Thus, we've made this discussion the last chapter in the book so you could read it early or later in your learning process. 7 | We leave it up to you to decide. 8 | 9 | Now that you're here, let's get started. 10 | First, if it isn't yet clear, Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it. 11 | You'll learn more about what this means in a bit. 12 | 13 | In the early days of Git (mostly pre 1.5), the user interface was much more complex because it emphasized this filesystem rather than a polished VCS. 14 | In the last few years, the UI has been refined until it's as clean and easy to use as any system out there; however, the stereotype lingers about the early Git UI that was complex and difficult to learn. 15 | 16 | The content-addressable filesystem layer is amazingly cool, so we'll cover that first in this chapter; then, you'll learn about the transport mechanisms and the repository maintenance tasks that you may eventually have to deal with. 17 | 18 | include::book/10-git-internals/sections/plumbing-porcelain.asc[] 19 | 20 | include::book/10-git-internals/sections/objects.asc[] 21 | 22 | include::book/10-git-internals/sections/refs.asc[] 23 | 24 | include::book/10-git-internals/sections/packfiles.asc[] 25 | 26 | include::book/10-git-internals/sections/refspec.asc[] 27 | 28 | include::book/10-git-internals/sections/transfer-protocols.asc[] 29 | 30 | include::book/10-git-internals/sections/maintenance.asc[] 31 | 32 | include::book/10-git-internals/sections/environment.asc[] 33 | 34 | === Summary 35 | 36 | At this point, you should have a pretty good understanding of what Git does in the background and, to some degree, how it's implemented. 37 | This chapter has covered a number of plumbing commands -- commands that are lower level and simpler than the porcelain commands you've learned about in the rest of the book. 38 | Understanding how Git works at a lower level should make it easier to understand why it's doing what it's doing and also to write your own tools and helper scripts to make your specific workflow work for you. 39 | 40 | Git as a content-addressable filesystem is a very powerful tool that you can easily use as more than just a VCS. 41 | We hope you can use your newfound knowledge of Git internals to implement your own cool application of this technology and feel more comfortable using Git in more advanced ways. 42 | -------------------------------------------------------------------------------- /diagram-source/progit.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/diagram-source/progit.sketch -------------------------------------------------------------------------------- /images/2fa-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/2fa-1.png -------------------------------------------------------------------------------- /images/account-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/account-settings.png -------------------------------------------------------------------------------- /images/advance-master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/advance-master.png -------------------------------------------------------------------------------- /images/advance-testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/advance-testing.png -------------------------------------------------------------------------------- /images/advance-testing.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/advance-testing 9 | 10 | 11 | 12 | images/advance-testing 13 | Created with Sketch. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | master 23 | 24 | 25 | 26 | 27 | f30ab 28 | 29 | 30 | 31 | 87ab2 32 | 33 | 34 | 35 | 34ac2 36 | 37 | 38 | 39 | 98ca9 40 | 41 | 42 | 43 | 44 | 45 | testing 46 | 47 | 48 | 49 | 50 | HEAD 51 | 52 | 53 | -------------------------------------------------------------------------------- /images/areas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/areas.png -------------------------------------------------------------------------------- /images/avatar-crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/avatar-crop.png -------------------------------------------------------------------------------- /images/basic-branching-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-1.png -------------------------------------------------------------------------------- /images/basic-branching-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/basic-branching-1 9 | 10 | 11 | 12 | 13 | images/basic-branching-1 14 | Created with Sketch. 15 | 16 | 17 | C0 18 | 19 | 20 | 21 | 22 | 23 | C1 24 | 25 | 26 | 27 | C2 28 | 29 | 30 | 31 | 32 | 33 | master 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /images/basic-branching-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-2.png -------------------------------------------------------------------------------- /images/basic-branching-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/basic-branching-2 9 | 10 | 11 | 12 | 13 | images/basic-branching-2 14 | Created with Sketch. 15 | 16 | 17 | 18 | C0 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | C1 27 | 28 | 29 | 30 | C2 31 | 32 | 33 | 34 | master 35 | 36 | 37 | 38 | iss53 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /images/basic-branching-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-3.png -------------------------------------------------------------------------------- /images/basic-branching-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/basic-branching-3 9 | 10 | 11 | 12 | 13 | images/basic-branching-3 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | C0 24 | 25 | 26 | 27 | C1 28 | 29 | 30 | 31 | C2 32 | 33 | 34 | 35 | C3 36 | 37 | 38 | 39 | 40 | master 41 | 42 | 43 | 44 | 45 | 46 | iss53 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /images/basic-branching-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-4.png -------------------------------------------------------------------------------- /images/basic-branching-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-5.png -------------------------------------------------------------------------------- /images/basic-branching-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-branching-6.png -------------------------------------------------------------------------------- /images/basic-merging-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-merging-1.png -------------------------------------------------------------------------------- /images/basic-merging-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-merging-2.png -------------------------------------------------------------------------------- /images/basic-rebase-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-rebase-1.png -------------------------------------------------------------------------------- /images/basic-rebase-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-rebase-2.png -------------------------------------------------------------------------------- /images/basic-rebase-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-rebase-3.png -------------------------------------------------------------------------------- /images/basic-rebase-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/basic-rebase-4.png -------------------------------------------------------------------------------- /images/benevolent-dictator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/benevolent-dictator.png -------------------------------------------------------------------------------- /images/blink-01-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-01-start.png -------------------------------------------------------------------------------- /images/blink-02-pr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-02-pr.png -------------------------------------------------------------------------------- /images/blink-03-pull-request-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-03-pull-request-open.png -------------------------------------------------------------------------------- /images/blink-04-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-04-email.png -------------------------------------------------------------------------------- /images/blink-04-pr-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-04-pr-comment.png -------------------------------------------------------------------------------- /images/blink-05-general-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-05-general-comment.png -------------------------------------------------------------------------------- /images/blink-06-final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/blink-06-final.png -------------------------------------------------------------------------------- /images/branch-and-history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/branch-and-history.png -------------------------------------------------------------------------------- /images/branch_widget_mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/branch_widget_mac.png -------------------------------------------------------------------------------- /images/branch_widget_win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/branch_widget_win.png -------------------------------------------------------------------------------- /images/centralized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/centralized.png -------------------------------------------------------------------------------- /images/centralized_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/centralized_workflow.png -------------------------------------------------------------------------------- /images/checkout-master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/checkout-master.png -------------------------------------------------------------------------------- /images/checkout-master.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/checkout-master 9 | 10 | 11 | 12 | 13 | images/checkout-master 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | master 24 | 25 | 26 | 27 | f30ab 28 | 29 | 30 | 31 | 87ab2 32 | 33 | 34 | 35 | 34ac2 36 | 37 | 38 | 39 | 98ca9 40 | 41 | 42 | 43 | 44 | testing 45 | 46 | 47 | 48 | 49 | HEAD 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /images/clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/clean.png -------------------------------------------------------------------------------- /images/collaborators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/collaborators.png -------------------------------------------------------------------------------- /images/commit-and-tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/commit-and-tree.png -------------------------------------------------------------------------------- /images/commits-and-parents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/commits-and-parents.png -------------------------------------------------------------------------------- /images/data-model-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/data-model-1.png -------------------------------------------------------------------------------- /images/data-model-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/data-model-2.png -------------------------------------------------------------------------------- /images/data-model-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/data-model-3.png -------------------------------------------------------------------------------- /images/data-model-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/data-model-4.png -------------------------------------------------------------------------------- /images/deltas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/deltas.png -------------------------------------------------------------------------------- /images/distributed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/distributed.png -------------------------------------------------------------------------------- /images/double-dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/double-dot.png -------------------------------------------------------------------------------- /images/email-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/email-settings.png -------------------------------------------------------------------------------- /images/forkbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/forkbutton.png -------------------------------------------------------------------------------- /images/git-bash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-bash.png -------------------------------------------------------------------------------- /images/git-diff-check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-diff-check.png -------------------------------------------------------------------------------- /images/git-fusion-boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-fusion-boot.png -------------------------------------------------------------------------------- /images/git-fusion-perforce-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-fusion-perforce-graph.png -------------------------------------------------------------------------------- /images/git-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-gui.png -------------------------------------------------------------------------------- /images/git-instaweb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-instaweb.png -------------------------------------------------------------------------------- /images/git-osx-installer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/git-osx-installer.png -------------------------------------------------------------------------------- /images/github_mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/github_mac.png -------------------------------------------------------------------------------- /images/github_win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/github_win.png -------------------------------------------------------------------------------- /images/gitk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/gitk.png -------------------------------------------------------------------------------- /images/gitlab-groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/gitlab-groups.png -------------------------------------------------------------------------------- /images/gitlab-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/gitlab-menu.png -------------------------------------------------------------------------------- /images/gitlab-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/gitlab-users.png -------------------------------------------------------------------------------- /images/head-to-master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/head-to-master.png -------------------------------------------------------------------------------- /images/head-to-master.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/head-to-master 9 | 10 | 11 | 12 | 13 | images/head-to-master 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | master 24 | 25 | 26 | 27 | testing 28 | 29 | 30 | 31 | f30ab 32 | 33 | 34 | 35 | 34ac2 36 | 37 | 38 | 39 | 98ca9 40 | 41 | 42 | 43 | HEAD 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /images/head-to-testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/head-to-testing.png -------------------------------------------------------------------------------- /images/head-to-testing.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/head-to-testing 9 | 10 | 11 | 12 | 13 | images/head-to-testing 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | master 23 | 24 | 25 | 26 | testing 27 | 28 | 29 | 30 | f30ab 31 | 32 | 33 | 34 | 34ac2 35 | 36 | 37 | 38 | 98ca9 39 | 40 | 41 | 42 | 43 | HEAD 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /images/integration-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/integration-manager.png -------------------------------------------------------------------------------- /images/interesting-rebase-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/interesting-rebase-1.png -------------------------------------------------------------------------------- /images/interesting-rebase-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/interesting-rebase-2.png -------------------------------------------------------------------------------- /images/interesting-rebase-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/interesting-rebase-3.png -------------------------------------------------------------------------------- /images/interesting-rebase-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/interesting-rebase-4.png -------------------------------------------------------------------------------- /images/interesting-rebase-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/interesting-rebase-5.png -------------------------------------------------------------------------------- /images/jb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/jb.png -------------------------------------------------------------------------------- /images/large-merges-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/large-merges-1.png -------------------------------------------------------------------------------- /images/large-merges-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/large-merges-2.png -------------------------------------------------------------------------------- /images/lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/lifecycle.png -------------------------------------------------------------------------------- /images/local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/local.png -------------------------------------------------------------------------------- /images/local.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/local 9 | 10 | 11 | 12 | images/local 13 | Created with Sketch. 14 | 15 | 16 | 17 | Local Computer 18 | 19 | Version Database 20 | Checkout 21 | 22 | 23 | File 24 | 25 | 26 | 27 | Version 3 28 | 29 | 30 | 31 | Version 2 32 | 33 | 34 | 35 | Version 1 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /images/lr-branches-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/lr-branches-1.png -------------------------------------------------------------------------------- /images/lr-branches-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/lr-branches-2.png -------------------------------------------------------------------------------- /images/maint-01-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-01-email.png -------------------------------------------------------------------------------- /images/maint-02-merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-02-merge.png -------------------------------------------------------------------------------- /images/maint-03-email-resp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-03-email-resp.png -------------------------------------------------------------------------------- /images/maint-04-target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-04-target.png -------------------------------------------------------------------------------- /images/maint-05-mentions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-05-mentions.png -------------------------------------------------------------------------------- /images/maint-06-unsubscribe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-06-unsubscribe.png -------------------------------------------------------------------------------- /images/maint-07-notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-07-notifications.png -------------------------------------------------------------------------------- /images/maint-08-notifications-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-08-notifications-page.png -------------------------------------------------------------------------------- /images/maint-09-contrib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-09-contrib.png -------------------------------------------------------------------------------- /images/maint-10-default-branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-10-default-branch.png -------------------------------------------------------------------------------- /images/maint-11-transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/maint-11-transfer.png -------------------------------------------------------------------------------- /images/managed-team-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/managed-team-1.png -------------------------------------------------------------------------------- /images/managed-team-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/managed-team-2.png -------------------------------------------------------------------------------- /images/managed-team-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/managed-team-3.png -------------------------------------------------------------------------------- /images/managed-team-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/managed-team-flow.png -------------------------------------------------------------------------------- /images/markdown-01-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-01-example.png -------------------------------------------------------------------------------- /images/markdown-02-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-02-tasks.png -------------------------------------------------------------------------------- /images/markdown-03-task-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-03-task-summary.png -------------------------------------------------------------------------------- /images/markdown-04-fenced-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-04-fenced-code.png -------------------------------------------------------------------------------- /images/markdown-05-quote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-05-quote.png -------------------------------------------------------------------------------- /images/markdown-06-emoji-complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-06-emoji-complete.png -------------------------------------------------------------------------------- /images/markdown-07-emoji.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-07-emoji.png -------------------------------------------------------------------------------- /images/markdown-08-drag-drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/markdown-08-drag-drop.png -------------------------------------------------------------------------------- /images/mentions-01-syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/mentions-01-syntax.png -------------------------------------------------------------------------------- /images/mentions-02-render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/mentions-02-render.png -------------------------------------------------------------------------------- /images/mentions-03-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/mentions-03-closed.png -------------------------------------------------------------------------------- /images/merging-workflows-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/merging-workflows-1.png -------------------------------------------------------------------------------- /images/merging-workflows-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/merging-workflows-2.png -------------------------------------------------------------------------------- /images/merging-workflows-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/merging-workflows-3.png -------------------------------------------------------------------------------- /images/merging-workflows-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/merging-workflows-4.png -------------------------------------------------------------------------------- /images/merging-workflows-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/merging-workflows-5.png -------------------------------------------------------------------------------- /images/new-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/new-repo.png -------------------------------------------------------------------------------- /images/neworg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/neworg.png -------------------------------------------------------------------------------- /images/newrepo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/newrepo.png -------------------------------------------------------------------------------- /images/newrepoform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/newrepoform.png -------------------------------------------------------------------------------- /images/orgs-01-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/orgs-01-page.png -------------------------------------------------------------------------------- /images/orgs-02-teams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/orgs-02-teams.png -------------------------------------------------------------------------------- /images/orgs-03-audit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/orgs-03-audit.png -------------------------------------------------------------------------------- /images/p4merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/p4merge.png -------------------------------------------------------------------------------- /images/perils-of-rebasing-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/perils-of-rebasing-1.png -------------------------------------------------------------------------------- /images/perils-of-rebasing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/perils-of-rebasing-2.png -------------------------------------------------------------------------------- /images/perils-of-rebasing-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/perils-of-rebasing-3.png -------------------------------------------------------------------------------- /images/perils-of-rebasing-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/perils-of-rebasing-4.png -------------------------------------------------------------------------------- /images/perils-of-rebasing-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/perils-of-rebasing-5.png -------------------------------------------------------------------------------- /images/posh-git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/posh-git.png -------------------------------------------------------------------------------- /images/pr-01-fail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/pr-01-fail.png -------------------------------------------------------------------------------- /images/pr-02-merge-fix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/pr-02-merge-fix.png -------------------------------------------------------------------------------- /images/public-small-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/public-small-1.png -------------------------------------------------------------------------------- /images/public-small-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/public-small-2.png -------------------------------------------------------------------------------- /images/public-small-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/public-small-3.png -------------------------------------------------------------------------------- /images/rebasing-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/rebasing-1.png -------------------------------------------------------------------------------- /images/rebasing-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/rebasing-2.png -------------------------------------------------------------------------------- /images/remote-branches-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/remote-branches-1.png -------------------------------------------------------------------------------- /images/remote-branches-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/remote-branches-2.png -------------------------------------------------------------------------------- /images/remote-branches-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/remote-branches-3.png -------------------------------------------------------------------------------- /images/remote-branches-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/remote-branches-4.png -------------------------------------------------------------------------------- /images/remote-branches-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/remote-branches-5.png -------------------------------------------------------------------------------- /images/replace1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/replace1.png -------------------------------------------------------------------------------- /images/replace2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/replace2.png -------------------------------------------------------------------------------- /images/replace3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/replace3.png -------------------------------------------------------------------------------- /images/replace4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/replace4.png -------------------------------------------------------------------------------- /images/replace5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/replace5.png -------------------------------------------------------------------------------- /images/reposettingslink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reposettingslink.png -------------------------------------------------------------------------------- /images/rerere1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/rerere1.png -------------------------------------------------------------------------------- /images/rerere1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/rerere1 9 | 10 | 11 | 12 | 13 | images/rerere1 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | master 21 | 22 | 23 | 24 | 25 | 26 | 27 | hello world 28 | 29 | 30 | 31 | 32 | 33 | 34 | hola world 35 | 36 | 37 | 38 | 39 | 40 | 41 | hello mundo 42 | 43 | 44 | 45 | 46 | 47 | 48 | i18n-world 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /images/rerere2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/rerere2.png -------------------------------------------------------------------------------- /images/rerere3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/rerere3.png -------------------------------------------------------------------------------- /images/reset-checkout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-checkout.png -------------------------------------------------------------------------------- /images/reset-ex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex1.png -------------------------------------------------------------------------------- /images/reset-ex2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex2.png -------------------------------------------------------------------------------- /images/reset-ex3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex3.png -------------------------------------------------------------------------------- /images/reset-ex4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex4.png -------------------------------------------------------------------------------- /images/reset-ex5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex5.png -------------------------------------------------------------------------------- /images/reset-ex6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-ex6.png -------------------------------------------------------------------------------- /images/reset-hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-hard.png -------------------------------------------------------------------------------- /images/reset-mixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-mixed.png -------------------------------------------------------------------------------- /images/reset-path1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-path1.png -------------------------------------------------------------------------------- /images/reset-path2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-path2.png -------------------------------------------------------------------------------- /images/reset-path3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-path3.png -------------------------------------------------------------------------------- /images/reset-soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-soft.png -------------------------------------------------------------------------------- /images/reset-squash-r1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-squash-r1.png -------------------------------------------------------------------------------- /images/reset-squash-r2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-squash-r2.png -------------------------------------------------------------------------------- /images/reset-squash-r3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-squash-r3.png -------------------------------------------------------------------------------- /images/reset-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-start.png -------------------------------------------------------------------------------- /images/reset-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/reset-workflow.png -------------------------------------------------------------------------------- /images/scripting-01-services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-01-services.png -------------------------------------------------------------------------------- /images/scripting-02-email-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-02-email-service.png -------------------------------------------------------------------------------- /images/scripting-03-webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-03-webhook.png -------------------------------------------------------------------------------- /images/scripting-04-webhook-debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-04-webhook-debug.png -------------------------------------------------------------------------------- /images/scripting-05-access-token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-05-access-token.png -------------------------------------------------------------------------------- /images/scripting-06-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-06-comment.png -------------------------------------------------------------------------------- /images/scripting-07-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/scripting-07-status.png -------------------------------------------------------------------------------- /images/signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/signup.png -------------------------------------------------------------------------------- /images/small-team-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-1.png -------------------------------------------------------------------------------- /images/small-team-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/small-team-1 9 | 10 | 11 | 12 | 13 | images/small-team-1 14 | Created with Sketch. 15 | 16 | 17 | 18 | 4b078 19 | 20 | 21 | 22 | 23 | 24 | 1edee 25 | 26 | 27 | 28 | 29 | 30 | 31 | 738ee 32 | 33 | 34 | 35 | 36 | 37 | 38 | fbff5 39 | 40 | 41 | 42 | 43 | 44 | 45 | origin/master 46 | 47 | 48 | 49 | 50 | 51 | 52 | master 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /images/small-team-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-2.png -------------------------------------------------------------------------------- /images/small-team-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-3.png -------------------------------------------------------------------------------- /images/small-team-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-4.png -------------------------------------------------------------------------------- /images/small-team-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-5.png -------------------------------------------------------------------------------- /images/small-team-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-6.png -------------------------------------------------------------------------------- /images/small-team-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-7.png -------------------------------------------------------------------------------- /images/small-team-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/small-team-flow.png -------------------------------------------------------------------------------- /images/smudge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/smudge.png -------------------------------------------------------------------------------- /images/snapshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/snapshots.png -------------------------------------------------------------------------------- /images/ssh-keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/ssh-keys.png -------------------------------------------------------------------------------- /images/topic-branches-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/topic-branches-1.png -------------------------------------------------------------------------------- /images/topic-branches-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/topic-branches-2.png -------------------------------------------------------------------------------- /images/two-branches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/two-branches.png -------------------------------------------------------------------------------- /images/two-branches.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | image/svg+xml 7 | 8 | images/two-branches 9 | 10 | 11 | 12 | 13 | images/two-branches 14 | Created with Sketch. 15 | 16 | 17 | 18 | 19 | 20 | master 21 | 22 | 23 | 24 | 25 | 26 | 27 | testing 28 | 29 | 30 | 31 | 32 | 33 | 34 | f30ab 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 34ac2 44 | 45 | 46 | 47 | 48 | 98ca9 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /images/undomerge-reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/undomerge-reset.png -------------------------------------------------------------------------------- /images/undomerge-revert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/undomerge-revert.png -------------------------------------------------------------------------------- /images/undomerge-revert2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/undomerge-revert2.png -------------------------------------------------------------------------------- /images/undomerge-revert3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/undomerge-revert3.png -------------------------------------------------------------------------------- /images/undomerge-start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/undomerge-start.png -------------------------------------------------------------------------------- /images/your-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/your-profile.png -------------------------------------------------------------------------------- /images/zsh-oh-my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/zsh-oh-my.png -------------------------------------------------------------------------------- /images/zsh-prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progit/progit2/55081eaf0bfb4b0f9bab287c0dd035bf604e43bc/images/zsh-prompt.png -------------------------------------------------------------------------------- /index.asc: -------------------------------------------------------------------------------- 1 | [#index] 2 | [index] 3 | == Index 4 | -------------------------------------------------------------------------------- /progit.asc: -------------------------------------------------------------------------------- 1 | = Pro Git 2 | Scott Chacon; Ben Straub 3 | :doctype: book 4 | :docinfo: 5 | :toc: 6 | :toclevels: 2 7 | :pagenums: 8 | :front-cover-image: image:book/cover.png[width=1050,height=1600] 9 | :icons: font 10 | 11 | include::book/license.asc[] 12 | 13 | include::book/preface_schacon.asc[] 14 | 15 | include::book/preface_ben.asc[] 16 | 17 | include::book/dedication.asc[] 18 | 19 | include::book/contributors.asc[] 20 | 21 | include::book/introduction.asc[] 22 | 23 | include::ch01-getting-started.asc[] 24 | 25 | include::ch02-git-basics-chapter.asc[] 26 | 27 | include::ch03-git-branching.asc[] 28 | 29 | include::ch04-git-on-the-server.asc[] 30 | 31 | include::ch05-distributed-git.asc[] 32 | 33 | include::ch06-github.asc[] 34 | 35 | include::ch07-git-tools.asc[] 36 | 37 | include::ch08-customizing-git.asc[] 38 | 39 | include::ch09-git-and-other-systems.asc[] 40 | 41 | include::ch10-git-internals.asc[] 42 | 43 | include::A-git-in-other-environments.asc[] 44 | 45 | include::B-embedding-git-in-your-applications.asc[] 46 | 47 | include::C-git-commands.asc[] 48 | 49 | ifdef::backend-pdf[include::index.asc[]] 50 | -------------------------------------------------------------------------------- /theme/epub/epub.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /theme/epub/layout.html: -------------------------------------------------------------------------------- 1 | {{ doctype }} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ title }} 10 | 11 | 12 | {{ content }} 13 | 14 | 15 | -------------------------------------------------------------------------------- /theme/html/html.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /theme/mobi/mobi.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /theme/pdf/pdf.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | --------------------------------------------------------------------------------