Nethence NEWDOC OLDDOC Lab Webmail Your IP BBDock  

setting up & operating GIT repositories

create simple local repo

    cd somefolder/
    git init

create real (bare) repo that will be used remotely only

as git user on the GIT server,

    mkdir project.git/
    cd project.git/
    git init --bare

fetch a remote repo

from a workstation or some server,

    git clone ssh://git@gitsrv/home/git/project.git

and if you got e.g. Gitlab up and running,

    git clone http://git@gitsrv/home/git/project.git

push to a remote repo after you started already

you can also create your own,

    cd project/
    git init
    git add *
    #git add --all
    git commit -m MESSAGE

and sync with the remote repo afterwards,

    git remote add origin ssh://git@gitsrv/home/git/project.git
    #git config --global push.default simple
    git push
    #git push --set-upstream origin master

create your own branch

first, choose the branch you want to pick from,

    git checkout release-1

then create yours,

    git branch release-1-with-my-feature
    git checkout release-1-with-my-feature

finally commit and eventually push your changes.

merge changes

create a minor branch against release v1 for you and others to commit,

    git checkout release-1
    git branch release-1.1.0
    git checkout release-1.1.0

merge your changes into the new minor branch,

    git merge release-1-with-my-feature

Note. merge --no-ff if you like.

deploy apps

update the list of branches and switch to the new minor branch,

    git fetch -a
    git checkout release-1.1.0
    #git pull

and restart the application.

handy tweaks

for docs, scripts & configs you do not want to track like hell,

    git config --global 'commit -a --allow-empty-message -m ""'