Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zagaran/djangit
Django-enhanced versions of classic git commands
https://github.com/zagaran/djangit
Last synced: about 2 months ago
JSON representation
Django-enhanced versions of classic git commands
- Host: GitHub
- URL: https://github.com/zagaran/djangit
- Owner: zagaran
- License: mit
- Created: 2022-03-16T12:33:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T17:44:53.000Z (over 1 year ago)
- Last Synced: 2023-08-18T20:11:44.189Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# djangit
Django-enhanced versions of classic git commands## Installing djangit
To install djangit, you will need ssh credentials for github. Runpip install git+ssh://[email protected]/zagaran/djangit.git
If the clone fails
because of missing credentials, you can generate and add a new
ssh key for github by following the instructions here: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
.Once djangit is installed, you can use djangit by adding management commands. Djangit currently
only supplies one command, which is "checkout". To install this command, make a new filedjango_app/management/commands/checkout.py
with the following contents
from djangit.checkout import Command
Now the "checkout" command will be available as a django management command.
## djangit checkout
The "checkout" command functions like git checkout, but also takes care of django migrations. The algorithm
identifies the largest migration subtree that is common to the two branches. It then migrates down to this
core subtree, switches branches, and then migrates back up on the new branch. The idea is to leave all common
migrations in place while interacting with branch-specific migrations only while that branch is checked out.To use the command, run
python manage.py checkout git_branch_name --plan
This will show you the commands that checkout plans to run. If you like what you see, then
remove the --plan flag:python manage.py checkout git_branch_name