1221
Comment:
|
1498
|
Deletions are marked like this. | Additions are marked like this. |
Line 33: | Line 33: |
== Cleanup local branches already merged into Master == 1. Check what has not been merged with {{{ git branch --no-merged }}} 2. Delete branch {{{ git branch -d xxx }}} *. All in one {{{ git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d }}} |
Git
- Linux distributed version controll.
- Notes on using and setting up on Ubuntu.
How to setup GIT private server
- Log into server, create git account, set it to use git-shell (no login), add .ssh/authorized keys for access with no password.
Create repo with $ git init --bare repository
1. On client edit
- --bare can't be used
- Setup .ssh/config, see example if using port, and can even use specific port.
Host githost HostName git.host.de Port 4019 User git
On client pc clone with $ git clone githost:repository
- #(edit some files
git commit -a # Commit all changes to the local version of the repository
git push origin master # Push changes to the server's version of the repository
Nice Git prompt in Linux bash
Git submodule
- Home dir add code as seperate submodule git
on server # sudo -u git git init --bare NewRepo
on pc code$ git submodule add git@git.server:NewRepo
Cleanup local branches already merged into Master
Check what has not been merged with git branch --no-merged
Delete branch git branch -d xxx
. All in one git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
...