A set of Git scripts to help developing and deploying.
Copy the bin folder to your home directory or the contents to any folder in PATH. If don't work do the following edit the .bashrc file and check it has the line:
PATH=$PATH:$HOME/bin
The scripts require the following packages:
realpath
You can install it with your system package manager. For example in Debian:
sudo apt-get install realpath
Generates a tar.gz with all changed files between current branch and destination branch. Before doing the file it updates all branches from origin.
git diffarchive [destination branch] [destination folder]
[destination branch] is the branch to diff from the current branch. master is used by default
[destination folder] is the folder where will write the file and the list of files included, by default is the parent folder.
$> git diffarchive master
The command must be executed in the root of the git repository. The file is generated in the parent directory with the name:
[repository_name]-[destination_branch]-[origin_branch]-patch_[date].tar.gz
Another file with the list of changes is also generated with the name:
[repository_name]-[destination_branch]-[origin_branch]-files_[date].txt
The command is usefull to gather all files needed to be uploaded to a remote server (production, development, etc) and upload it manually.
Fast forward every branch to be updated from their remote
$> git updateall
This command is usefull to update the entire local repository from the remote repositories
Pull all remote branches to the current one.
$> git pullall
This command is usefull when working with many developers in the same proyect with hight posibilities of collisions. A updated branch is very important in this cases.
This command is usefull to update your branch before a deploy using the diffarchive command.
Push current branch to designed branchs in all origins
git pushall [destination branch]
[destination branch] is the branch to push from the current branch. dev master is used by default
$> git pushall
Push the current branch to all origin's branchs with name dev or master (default values)
$> git pushall my_branch my_other_branch
Push the current branch to all origin's branchs with name my_branch or my_other_branch
This command is usefull to push your changes to multiple origins or/and to multiple branches
Create a tar file with all the files changed but not commited in the current branch or for a commit id.
git changesarchive [commit id]
[commit id] is the commit id used to generate the archive with the changed files. If not commit id is set all uncommited changes will be used.
Generate a file with all uncommited changes
$> git changesarchive
Generate a file with all files changed in a commit
$> git changesarchive 4670ddc015
This command is usefull to get the current changed files or the files affected by a commit.