https://github.com/epomatti/gitflow-django-demo
Git Flow + Django
https://github.com/epomatti/gitflow-django-demo
django git-flow python
Last synced: 4 months ago
JSON representation
Git Flow + Django
- Host: GitHub
- URL: https://github.com/epomatti/gitflow-django-demo
- Owner: epomatti
- License: mit
- Created: 2019-07-27T15:15:44.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-03-20T14:05:17.000Z (about 4 years ago)
- Last Synced: 2025-01-17T18:41:55.689Z (about 1 year ago)
- Topics: django, git-flow, python
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git Flow with Django
Project to learn Django commands versioned with Git Flow.

## Setup
```sh
python3 -m venv env
. env/bin/activate
pip install -r requirements.txt
```
To add new app:
```sh
django-admin startapp ''
```
Run it:
```sh
python manage.py runserver
```
## Git Flow
### Develop Branch
Create `develop` branch
```shell
git checkout -b develop
git push origin develop
git branch -a
```
### Feature Branch
Create branch from `develop`, stage and commit:
```shell
git checkout -b purepython develop
git add .
git status
git commit -m "first commit"
```
Merge:
```shell
git checkout develop
git merge --no-ff purepython
git push origin develop
git branch -d purepython
```
### Release Branch
Change, stage, commit, merge to `main`, tag, and push:
```shell
git checkout -b release-1.2
git commit -a -m "some change"
git checkout main
git merge --no-ff release-1.2
git tag -a 1.2 -m "new release 1.2"
git push --tags origin main
```
Merge to `develop` and delete release:
```shell
git checkout develop
git merge --no-ff release-1.2
git branch -d release-1.2
```
### Hotfix Branch
Create `hotfix` branch, bump version and fix the problem:
```shell
git checkout -b hotfix-1.2.1 main
./bump-version.sh 1.2.1
git commit -a -m "Bumped version number to 1.2.1"
git commit -m "Fixed severe production problem"
```
Merge to `main`, tag and push (with tags):
```shell
git checkout main
git merge --no-ff hotfix-1.2.1
git tag -a 1.2.1
git push --tags origin main
```
Merge to `develop` and delete branch:
```shell
git checkout develop
git merge --no-ff hotfix-1.2.1
git push --tags origin develop
git branch -d hotfix-1.2.1
```
## Sources
Django
https://www.django-rest-framework.org/tutorial/quickstart/
https://dfpp.readthedocs.io/en/latest/chapter_01.html
Git Flow
https://githowto.com/
https://danielkummer.github.io/git-flow-cheatsheet/