Git
git submodule update --initSettings
Username
in a local git repo
git config user.name "iocast"
git config user.email "iocast@me.com"or for global settings
git config --global user.name "iocast"
git config --global user.email "iocast@me.com"General
download from git repository (normally branch ‘master’)
git clone <remote_repo>download specific branch
git clone -b <branch> <remote_repo>commit changes (check if you are on the correct branch)
git commit -m "message"Push / Pull
send branch to repository/server
git push origin <branch>get branch from repository/server (update)
git pull origin <branch>resetting local repository
git reset --hard origin/masterBranching
list all branches
Options:
-a- lists all branches
-r lists all remote branches
git branch [options]
create local branch
git branch developdelete a branch (origin - server)
git branch -d develop
git push origin --delete developswitch branch to work on it
git checkout developpush branch to repository/server
git push origin <name>Tagging
first of all switch to master
git checkout masterand if necessary merge from a other branch
git merge --no-ff <branch>create tag
git tag -a 1.2 -m "message"push to repository/server
git push --tagslist tags
git tagchange to tag
git checkout <tag>or make changes based on this tag (e.g. for hotfixes for this specific tag) where the first argument is the new branch name an the second is the tag name
git checkout -b hotfix-1.3.1 1.3Release Managment
assume we are working on branch ‘develop’ an are ready to create a new release.
Releases
Creating
Switched to a new branch “release-1.2”
git checkout -b release-1.2 developchange version number on the notes or other files and commit it
git commit -a -m "Bumped version number to 1.2"Working
then modify all files needed for release-1.2 and commit changes (several commits can take place)
git commit -m "message"Finishing
Now we can finish this release. Switch to branch ‘master’
git checkout mastermerge from the release-1.2 branch and push to repository/server
git merge --no-ff release-1.2
git push origin mastertag as release in branch master and push tag to repository/server
git tag -a 1.2 -m "message"
git push --tagsrelease banch on our local drive is not needed anymore. Deleted branch release-1.2
git branch -d release-1.2Hot Fixes
Hot fixes are done from the master (or release) branch.
Creating
Switched to a new branch “hotfix-1.2.1”
git checkout -b hotfix-1.2.1 masterchange version number on the notes or other files and commit it
git commit -a -m "Bumped version number to 1.2.1"Working
then modify all files needed files for hotfix-1.21 and commit changes (several commits can take place)
git commit -m "message"Finishing
Switched to branch ‘master’
git checkout mastermerge changes
git merge --no-ff hotfix-1.2.1tag it and push tag to repository/server
git tag -a 1.2.1 -m "message"
git push --tagswitch to develop and merge hotfix into it
git checkout develop
git merge --no-ff hotfix-1.2.1and delete hotfix
git branch -d hotfix-1.2.1karma style
http://karma-runner.github.io/0.10/dev/git-commit-msg.html
Format of the commit message:
Allowed