========================== Managing git with chrome ========================== Chrome =========== Get in the right path, as: /home/git/siti/new_one and cast a git init:: git init --bare Optionaly ------------- Edit local description:: vim description Remote ========= Get inside the folder that contains the repo and cast:: git init Create a gitignore file inside .git in case something has to stay behind vim .git/gitignore Create a remote for chrome and set it as default:: git remote add origin git@chrome:path/name git push -u origin master New client ============== to clone the new repo cast:: git clone git@chrome:/home/git/siti/new_one git clone --depth 1 git@chrome:/home/git/siti/new_one Pubblicarlo su Zoo =================== Aggiungere dentro al .git il file:: touch git-daemon-export-ok Per renderlo disponibile sia al Demone git che a git web:: cd /var/cache/git/ ln -s /home/git/garage/ ./ GUI ========== Come tool per vedere i diff installare ``kompare`` , ``git difftool`` per lanciarlo. Come UI generale: git-cola Esterni: gitkraken: https://www.gitkraken.com/download :: apt-get install libgnome-keyring0 Ammend =========== :: # aggiungere al precedente commit git commit --amend Branches =========== :: # show the tre git log --oneline --decorate --graph --all # create git branch -b hotfix # delete git branch -d hotfix # eliminare sul server git push origin --delete temp_branch # non ancora merged git branch --no-merged # Seguire un branch presente sul remoto # il riferimento e' visibile in git remote git checkout -b dev origin/dev # uguale a git checkout --track origin/dev git checkout dev A git branch -vv // vedere dove tirano e come sono messi git fetch --all; git branch -vv # Merge just one file from an other branch git checkout --patch other_branch file # Se il file non esiste nel branch di destinazione: touch file git add . git checkout --patch other_branch file Rebase ------------ Si usa per aggiornare ad es. un branch di sviluppo a master in modo da poter proporre un merge lineare da master al proprio branch:: git checkout experiment git rebase master Dopodiche' master potra' fare un merge di experiment senza troppi casini. * https://git-scm.com/book/en/v2/Git-Branching-Rebasing Undo a commit =============== :: # go back one commit git reset --hard HEAD^ # go back 3 commit git reset --hard HEAD~3 # go back one commit for a file git reset --hard HEAD^ file_name A