Package: gitone
IntroductionThegitonePython package takes some of the tedium out ofgitversion control by rolling multiple git shell commands into one shell command or Python function.Unlike git shell commands,gitoneshell commands and Python functions can automatically generate commit messages if a commit message is not provided!You can usegitoneinyour terminal (e.g.bash,zsh,fish, etc.) oryour favorite Python environment (e.g.PyCharmorVisual Studio Code).ThegitonePython package consists of 8 shell commands and Python functions:cam, which stands forgit commit-am, will add and commit all changes made to tracked files.camp, which stands forgit commit-am&& git push, will add and commit all changes made to tracked files and push the commit to the remote repository.acm, which stands forgit add--all&& git commit-m, will add and commit all changes made to all files and push the changes to the remote repository.acmp, which stands forgit add--all&& git commit-m&& git push, will add and commit all changes made to all files and push the changes to the remote repository.In summary,camandcampwork on only tracked files (those that have previously been added to git’s index),
whileacmandacmpwork on all files by adding untracked files to git’s index.There are also the--amendversions of the above:amend, which is short forgit commit--amend-am, will overwrite the previous commit by adding and committing all changes made to tracked files.amendp, which is short forgit commit--amend-am&& git push--force, will overwrite the previous commit by adding and committing all changes made to tracked files and then force push the overwritten commit to the remote repository.aamend, which is short forgit add--all&& git commit--amend-m, will overwrite the previous commit by adding and committing all changes made to all files.aamendp, which is short forgit add--all&& git commit--amend-m&& git push--force, will overwrite the previous commit by adding and committing all changes made to all files and then force push the overwritten commit to the remote repository.Similarly to the first four,amendandamendpwork on only tracked files (those that have previously been added to git’s index),
whileaamendandaamendpwork on all files by adding untracked files to git’s index.Allgitonefunctions and commands rely on theGitPythonPython library.
The command line interface relies on theclickPython library.Documentation and CodeThe documentation is hosted athttps://py4ds.github.io/gitone/.The code is hosted athttps://github.com/py4ds/gitone.Installation$pipinstallgitoneUsageRun any of the available shell commands or Python functions without arguments and a commit message will be automatically generated.>>>camp()>>>acmp()>>>cam()>>>acm()$camp$acmp$cam$acmYou can also pass a commit message to any of the functions or shell commands.>>>camp(message="Made some changes.")>>>acmp("Lemme try something.")>>>cam("Not sure what changed.")>>>acm("Should be OK now.")When using the shell commands. Do not wrap the commit message in quotes ("") or they will be included in the commit message.$campMadesomechanges.$acmpLemmetrysomething.$camNotsurewhatchanged.$acmShouldbeOKnow.To overwrite the previous commit, you can use the amend functions.If you do not provide a commit message, the previous commit message will be reused.>>>amend()>>>amendp()>>>aamend()>>>aamendp()$amend$amendp$aamend$aamendpNext StepsSetting up a repo can be a pain.Write aninitfunction and command to handle all of the repo setup steps like inthis Makefile. Inspired by theusethisR package.