Chapters ▾
  1. 1. Memulai

    1. 1.1 Tentang Version Control
    2. 1.2 Sejarah Singkat Git
    3. 1.3 Dasar-dasar Git
    4. 1.4 Command Line
    5. 1.5 Memasang Git
    6. 1.6 Pengaturan Awal Git
    7. 1.7 Mendapatkan Bantuan
    8. 1.8 Kesimpulan
  2. 2. Git Basics

    1. 2.1 Mendapatkan Repository Git
    2. 2.2 Recording Changes to the Repository
    3. 2.3 Viewing the Commit History
    4. 2.4 Undoing Things
    5. 2.5 Working with Remotes
    6. 2.6 Tagging
    7. 2.7 Alias Git
    8. 2.8 Summary
  3. 3. Git Branching

    1. 3.1 Branches in a Nutshell
    2. 3.2 Basic Branching and Merging
    3. 3.3 Branch Management
    4. 3.4 Branching Workflows
    5. 3.5 Remote Branches
    6. 3.6 Rebasing
    7. 3.7 Summary
  4. 4. Git di Server

    1. 4.1 Protokol
    2. 4.2 Getting Git on a Server
    3. 4.3 Generating Your SSH Public Key
    4. 4.4 Setting Up the Server
    5. 4.5 Git Daemon
    6. 4.6 Smart HTTP
    7. 4.7 GitWeb
    8. 4.8 GitLab
    9. 4.9 Third Party Hosted Options
    10. 4.10 Ringkasan
  5. 5. Distributed Git

    1. 5.1 Distributed Workflows
    2. 5.2 Contributing to a Project
    3. 5.3 Maintaining a Project
    4. 5.4 Summary
  1. 6. GitHub

    1. 6.1 Pengaturan dan Konfigurasi Akun
    2. 6.2 Contributing to a Project
    3. 6.3 Maintaining a Project
    4. 6.4 Mengelola Organization
    5. 6.5 Scripting GitHub
    6. 6.6 Ringkasan
  2. 7. Git Tools

    1. 7.1 Revision Selection
    2. 7.2 Interactive Staging
    3. 7.3 Stashing and Cleaning
    4. 7.4 Signing Your Work
    5. 7.5 Searching
    6. 7.6 Rewriting History
    7. 7.7 Reset Demystified
    8. 7.8 Advanced Merging
    9. 7.9 Rerere
    10. 7.10 Debugging with Git
    11. 7.11 Submodules
    12. 7.12 Bundling
    13. 7.13 Replace
    14. 7.14 Credential Storage
    15. 7.15 Summary
  3. 8. Kostumisasi Git

    1. 8.1 Konfigurasi Git
    2. 8.2 Git Attributes
    3. 8.3 Git Hooks
    4. 8.4 An Example Git-Enforced Policy
    5. 8.5 Ringkasan
  4. 9. Git and Other Systems

    1. 9.1 Git as a Client
    2. 9.2 Migrating to Git
    3. 9.3 Summary
  5. 10. Git Internals

    1. 10.1 Plumbing and Porcelain
    2. 10.2 Git Objects
    3. 10.3 Git References
    4. 10.4 Packfiles
    5. 10.5 The Refspec
    6. 10.6 Transfer Protocols
    7. 10.7 Maintenance and Data Recovery
    8. 10.8 Environment Variables
    9. 10.9 Summary
2nd Edition

A3.11 Appendix C: Git Commands - Administration

Administration

If you’re administering a Git repository or need to fix something in a big way, Git provides a number of administrative commands to help you out.

git gc

The git gc command runs "garbage collection" on your repository, removing unnecessary files in your database and packing up the remaining files into a more efficient format.

This command normally runs in the background for you, though you can manually run it if you wish. We go over some examples of this in Maintenance.

git fsck

The git fsck command is used to check the internal database for problems or inconsistencies.

We only quickly use this once in Data Recovery to search for dangling objects.

git reflog

The git reflog command goes through a log of where all the heads of your branches have been as you work to find commits you may have lost through rewriting histories.

We cover this command mainly in RefLog Shortnames, where we show normal usage to and how to use git log -g to view the same information with git log output.

We also go through a practical example of recovering such a lost branch in Data Recovery.

git filter-branch

The git filter-branch command is used to rewrite loads of commits according to certain patterns, like removing a file everywhere or filtering the entire repository down to a single subdirectory for extracting a project.

In Removing a File from Every Commit we explain the command and explore several different options such as --commit-filter, --subdirectory-filter and --tree-filter.

In Git-p4 and TFS we use it to fix up imported external repositories.

AltStyle によって変換されたページ (->オリジナル) /