Wprowadzenie
git-flow jest zbiorem rozszerzeń git dostarczającym wysokopoziomowe operacje na repozytorium, wspierającym strategię rozkałęziania opracowaną przez Vincenta Driessen'a. Czytaj więcej
★ ★ ★
Ta ściągawka prezentuje podstawy użycia operacji git-flow.
★ ★ ★
Podstawowe wskazówki
- Git flow dostarcza świetną pomoc z poziomu wiersza poleceń. Przeczytaj uważne, aby dostrzec co się wydarzy...
- Sourcetree - klient dla OSX/Windows jest wyśmienitą nakładką graficzną dla git wspierającą również git-flow.
- Git-flow bazuje na scalaniu. Nie używa zmiany bazy do integorwania zmian.
★ ★ ★
Konfiguracja
- Zanim zaczniesz potrzebujesz działającej instalacji git.
- Git flow działa na systemach OSX, Linux oraz Windows
★ ★ ★
OSX
Homebrew$ brew install git-flowMacports
$ port install git-flow
Linux
$ apt-get install git-flow
Windows (Cygwin)
$ wget -q -O - --no-check-certificate https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash
Potrzebujesz wget oraz util-linux żeby zainstalować git-flow.
Szczegółową instrukcję instalacji git możesz znaleźć na git flow wiki.
![install git-flow](img/download.png)
Pierwsze kroki
Żeby dostować ustawienia Twojego projektu Git flow musi zostać zainicjalizowany.
★ ★ ★
Inicjalizacja
Rozpocznij używanie git-flow inicjalizując go w istniejącym repozytorium git:
git flow init
Będziesz musiał odpowiedzieć na kilka pytań dotyczących nazewnictwa gałęzi.
Zaleca się stosowanie wartości domyślnych.
Funkcjonalności
- Rozwój nowych funkcjonalności przyszłych wydań.
- Zazwyczaj istnieją tylko w repozytoriach deweloperów.
★ ★ ★
Rozpocznij nową funkcjonalność
Rozwój nowej funkcjonalności rozpoczyna się od gałęzi 'develop'.
Rozpocznij rozwój nowej funkcjonalności używając:
git flow feature start MYFEATURE
W ten sposób tworzysz gałąź dla nowej funkcjonalności bazując na gałęzi 'develop' jednocześnie się na nią przełączając.
Zakończ funkcjonalność
Zakończ rozwój funkcjonalnośc. Ta czynność spowoduje:
- Scali gałąź MYFEATURE do 'develop'
- Usunie gałąź funkcjonalności
- Przełączy spowrotem do gałęzi 'develop'
git flow feature finish MYFEATURE
Opublikowanie funkcjonalności
Rozwijasz funkcjonalność w grupie?
Opublikuj funkcjonalność na serwerze zdalnym, dzięki czemu będą jej mogli używać inni użytkownicy.
git flow feature publish MYFEATURE
Pobieranie opublikowanej zmiany
Pobierz zmianę opublikowaną przez innego użytkownika.
git flow feature pull origin MYFEATURE
Możesz śledzić zmianę na serwerze źródłowym używając git flow feature track MYFEATURE
Utwórz wydanie
- Support preparation of a new production release
- Allow for minor bug fixes and preparing meta-data for a release
★ ★ ★
Start a release
To start a release, use the git flow release command. It creates a release branch created from the 'develop' branch.
git flow release start RELEASE [BASE]
You can optionally supply a [BASE]
commit sha-1 hash to start the release from. The commit must
be on the
'develop' branch.
★ ★ ★
It's wise to publish the release branch after creating it to allow release commits by other developers. Do it similar to feature publishing with the command:
git flow release publish RELEASE
(You can track a remote release with the git flow release track RELEASE
command)
Finish up a release
Finishing a release is one of the big steps in git branching. It performs several actions:
- Merges the release branch back into 'master'
- Tags the release with its name
- Back-merges the release into 'develop'
- Removes the release branch
git flow release finish RELEASE
Don't forget to push your tags withgit push --tags
Hotfixes
- Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version
- May be branched off from the corresponding tag on the master branch that marks the production version.
★ ★ ★
git flow hotfix start
Like the other git flow commands, a hotfix is started with
git flow hotfix start VERSION [BASENAME]
The version argument hereby marks the new hotfix release name. Optionally you can specify a basename to start from.
Finish a hotfix
By finishing a hotfix it gets merged back into develop and master. Additionally the master merge is tagged with the hotfix version.
git flow hotfix finish VERSION
Backlog
★ ★ ★
- Not all available commands are covered here, only the most important ones
- You can still use git and all its commands normally as you know them, git flow is only a tooling collection
- The 'support' feature is still beta, using it is not advised
- If you'd like to supply translations I'd be happy to integrate them
★ ★ ★