Chapters ▾
  1. 1. Pierwsze kroki

    1. 1.1 Wprowadzenie do kontroli wersji
    2. 1.2 Krótka historia Git
    3. 1.3 Podstawy Git
    4. 1.4 Linia poleceń
    5. 1.5 Instalacja Git
    6. 1.6 Wstępna konfiguracja Git
    7. 1.7 Uzyskiwanie pomocy
    8. 1.8 Podsumowanie
  2. 2. Podstawy Gita

    1. 2.1 Pierwsze repozytorium Gita
    2. 2.2 Rejestrowanie zmian w repozytorium
    3. 2.3 Podgląd historii rewizji
    4. 2.4 Cofanie zmian
    5. 2.5 Praca ze zdalnym repozytorium
    6. 2.6 Tagowanie
    7. 2.7 Aliasy
    8. 2.8 Podsumowanie
  3. 3. Gałęzie Gita

    1. 3.1 Czym jest gałąź
    2. 3.2 Podstawy rozgałęziania i scalania
    3. 3.3 Zarządzanie gałęziami
    4. 3.4 Sposoby pracy z gałęziami
    5. 3.5 Gałęzie zdalne
    6. 3.6 Zmiana bazy
    7. 3.7 Podsumowanie
  4. 4. Git na serwerze

    1. 4.1 Protokoły
    2. 4.2 Uruchomienie Git na serwerze
    3. 4.3 Generowanie Twojego publicznego klucza SSH
    4. 4.4 Konfigurowanie serwera
    5. 4.5 Git Daemon
    6. 4.6 Smart HTTP
    7. 4.7 GitWeb
    8. 4.8 GitLab
    9. 4.9 Inne opcje hostowania przez podmioty zewnętrzne
    10. 4.10 Podsumowanie
  5. 5. Rozproszony Git

    1. 5.1 Rozproszone przepływy pracy
    2. 5.2 Wgrywanie zmian do projektu
    3. 5.3 Utrzymywanie projektu
    4. 5.4 Podsumowanie
  1. 6. GitHub

    1. 6.1 Account Setup and Configuration
    2. 6.2 Contributing to a Project
    3. 6.3 Maintaining a Project
    4. 6.4 Managing an organization
    5. 6.5 Scripting GitHub
    6. 6.6 Summary
  2. 7. Narzędzia Gita

    1. 7.1 Wskazywanie rewizji
    2. 7.2 Interaktywne używanie przechowali
    3. 7.3 Schowek i czyszczenie
    4. 7.4 Signing Your Work
    5. 7.5 Searching
    6. 7.6 Przepisywanie historii
    7. 7.7 Reset Demystified
    8. 7.8 Advanced Merging
    9. 7.9 Rerere
    10. 7.10 Debugowanie z Gitem
    11. 7.11 Moduły zależne
    12. 7.12 Bundling
    13. 7.13 Replace
    14. 7.14 Credential Storage
    15. 7.15 Podsumowanie
  3. 8. Dostosowywanie Gita

    1. 8.1 Konfiguracja Gita
    2. 8.2 Git Attributes
    3. 8.3 Git Hooks
    4. 8.4 An Example Git-Enforced Policy
    5. 8.5 Summary
  4. 9. Git i inne systemy

    1. 9.1 Git jako klient
    2. 9.2 Migracja do Gita
    3. 9.3 Podsumowanie
  5. 10. Mechanizmy wewnętrzne w Git

    1. 10.1 Komendy typu plumbing i porcelain
    2. 10.2 Obiekty Gita
    3. 10.3 Referencje w Git
    4. 10.4 Spakowane pliki (packfiles)
    5. 10.5 Refspec
    6. 10.6 Protokoły transferu
    7. 10.7 Konserwacja i odzyskiwanie danych
    8. 10.8 Environment Variables
    9. 10.9 Podsumowanie
2nd Edition

A3.2 Appendix C: Git Commands - Getting and Creating Projects

Getting and Creating Projects

There are two ways to get a Git repository. One is to copy it from an existing repository on the network or elsewhere and the other is to create a new one in an existing directory.

git init

To take a directory and turn it into a new Git repository so you can start version controlling it, you can simply run git init.

We first introduce this in Pierwsze repozytorium Gita, where we show creating a brand new repository to start working with.

We talk briefly about how you can change the default branch from "master" in Gałęzie zdalne.

We use this command to create an empty bare repository for a server in Umieszczanie czystego repozytorium na serwerze.

Finally, we go through some of the details of what it actually does behind the scenes in Komendy typu plumbing i porcelain.

git clone

The git clone command is actually something of a wrapper around several other commands. It creates a new directory, goes into it and runs git init to make it an empty Git repository, adds a remote (git remote add) to the URL that you pass it (by default named origin), runs a git fetch from that remote repository and then checks out the latest commit into your working directory with git checkout.

The git clone command is used in dozens of places throughout the book, but we’ll just list a few interesting places.

It’s basically introduced and explained in [_git_cloning], where we go through a few examples.

In Uruchomienie Git na serwerze we look at using the --bare option to create a copy of a Git repository with no working directory.

In Bundling we use it to unbundle a bundled Git repository.

Finally, in Klonowanie projektu z modułami zależnymi we learn the --recursive option to make cloning a repository with submodules a little simpler.

Though it’s used in many other places through the book, these are the ones that are somewhat unique or where it is used in ways that are a little different.

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