git commands, clone = checkout git stash, git commit, git push, git pull, and Djnago common used commands in deployment
When you start committing projects, merge to apply trunk in all branches so that it continues with additional functionalities that should come in all versions. Test your code first to make sure there are no errors that you would unexpectedly apply in deployment. Start trunk in development, separately with development database and config.
When you start committing.
git status
This command shows you what has already been changed since the last commit.
git add
With "git add" comand you can add files in commit to push it to the server.
git add *
Some people do everything in commit but I don't recommend it because several unnecessary files can get into commit so it might work better with one behind the other files.
For example
git add crawler/management/commands/adzunaxml.py crawler/management/commands
Now you comit your changes with a comment so that with the next command you can push all changes.
git commit
git push
Successfully push in trunk?
Then you can go to the next step and marge trunk with development branche
To make clear that we always have trunk it is never installed anywhere you can run it separately but trunk is a central code base that is central in all branches.. Then each branch may have its own version differences which is usually needed for different countries and different languages because not only translation is important in some countries customers and customer requirements are completely different and there are differences that's why we make a separate branche for each country.
Trunk would be the main body of development, originating from the start of the project until the present. Branch will be a copy of code derived from a certain point in the trunk that is used for applying major changes to the code while preserving the integrity of the code in the trunk.
So in this way if we change something that has yet to be applied in all versions. Then we do that in trunk / master, then we commit it to trunk / master.. Then we read it in development branch of a certain country, test, and make database changes, translations etc. in developlent.. When everything is ready and everything tested then we put it in development and update the deployment version. In this way we ensure that the wrong version of a site is never set up or mixed.
In development version of a certain branch
DEV
git remote -v show
git pull upstream master ( marge trunk with confilcts )
grep -r "<<<<<<< HEAD"
In most of conflicts head should be.. For ads
git commit
git push
DEP
In deployment can you then pull changes marged with trunk.
git pull ( branche in deployment )
git pull origin master
Yet another example that often could occur.
Git stash
git stash = local copy save and return to head.
# ... hack hack hack ...
$ git stash
$ edit emergency fix
$ git commit -a -m "Fix in a hurry"
$ git stash pop
# ... continue hacking ...
Only if you need to download something first.
git checkout
Number of commands with which one can compile translations and modify database.
python manage.py makemessages
python manage.py compilemessages
Full post about translation in Django
https://www.webdeveloper.today/2020/12/django-translation-commonly-used.html
python manage.py makemigrations viewjob
python manage.py migrate viewjob
More information about changes to the database, this operation is also common because we still work with relative database.
https://www.webdeveloper.today/2021/03/add-database-field-adjust-models-for.html
Comments
Post a Comment