This scripts are coded to help in the creating, maintenance, fetch, and the workflow of our GIT repositories on a private server, accessible via ssh
Must run lvk-initial-configuration.sh before any other script
To start download the gitScritps : mkdir -p $HOME/.lvk/ cd $HOME/.lvk/ git clone https://github.com/pablopda/gitScripts.git
Special scripts: to avoid enter the password all the times you can use sshkey.sh script. sshkey.sh let you create public and private keys, upload it to the server, install keychain and configurate it.
- To creato or recover a repo you must:
-
Create: lvk-new-repo.sh nameOfTheRepo
-
Get: lvk-repos-get.sh Where can be:
- -a | --all : Pull all the repos in the server
- -g | --one : Get the repo with name
- -l | --list : List the repositories availables on the server
-
After we get the repo to work on, we must make a new branch where implement the new feature we want git checkout -b FeatureBranchName
-
Start implementation Loop of the feature: While(!isReadey(feture)) {
- Edit / create / delete code files
- A couple of time in the process we must run lvk-hack.sh (to rebase our current work over the last commited version of the files).
- In this step the script do:
- git commit -a
- change to branch master
- pull changes from server
- change to branch FeatureBranchName
- rebase of FeatureBranchName to the updated master
This use git commit -a so if you want to not commit some files use .gitignore
- }
-
So after you finish the implementation of the feature you must run ship.sh to update remote server version of the repo. This script does:
- Change to master
- Merge master with FeatureBranchName
- Push master to the server
- Return to branch FeatureBranchName
-
Experimental if we are working on a objective-c project we must use lvk-ship.sh. Before make the ship process like ship.sh, this script clone the branch FeatureBranchName to the tmp subdir compile it.
- If there is no error just do the same as ship.sh
- if there is an error abort and return the message in the tmp directory with name error.log
NOTE: you must have xcode configured to be compiled for the emulator
-
The man pages are installed into $HOME/.lvk/gitScripts/man First time you use this scripts must run lvk-initial-configuration.sh before any other script The initial configuration script modify environment variables, becouse that, you must open new console or run . $HOME/.bashrc
-
Updating the gitScripts NOTE: When you update the scripts please check the configuration ($HOME/.lvk/.lvkgit.cfg) have all the declarated variables declarated in the updatede version).