A PCRE internal error occured. This might be caused by a faulty plugin
====== Differences ====== This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
packages:git [2014/05/30 00:50] admin [Server Side Install] |
packages:git [2015/05/24 18:45] (current) admin [Creating Your Local git Copy] |
||
|---|---|---|---|
| Line 19: | Line 19: | ||
| ---- | ---- | ||
| <code> | <code> | ||
| - | sudo apt-get update | + | > sudo apt-get update |
| - | sudo apt-get install git | + | > sudo apt-get install git |
| + | </code> | ||
| + | |||
| + | === Create git user and repository === | ||
| + | <code> | ||
| + | > sudo adduser git | ||
| + | Adding user `git' ... | ||
| + | Adding new group `git' (1001) ... | ||
| + | Adding new user `git' (1001) with group `git' ... | ||
| + | Creating home directory `/home/git' ... | ||
| + | Copying files from `/etc/skel' ... | ||
| + | Enter new UNIX password: | ||
| + | Retype new UNIX password: | ||
| + | passwd: password updated successfully | ||
| + | Changing the user information for git | ||
| + | Enter the new value, or press ENTER for the default | ||
| + | Full Name []: | ||
| + | Room Number []: | ||
| + | Work Phone []: | ||
| + | Home Phone []: | ||
| + | Other []: | ||
| + | Is the information correct? [Y/n] Y | ||
| </code> | </code> | ||
| - | === Create git repository === | ||
| Create the main repository for git projects: | Create the main repository for git projects: | ||
| <code> | <code> | ||
| Line 76: | Line 96: | ||
| Login to the server and init a bare repository: | Login to the server and init a bare repository: | ||
| <code> | <code> | ||
| - | > ssh gituser@my.server.tld | + | > ssh <gituser>@my.server.tld |
| > cd /home/git/<git-projects> | > cd /home/git/<git-projects> | ||
| - | > mkdir <project-1.git> | + | > mkdir <project-name.git> |
| - | > cd <project-1.git> | + | > cd <project-name.git> |
| > git init --bare | > git init --bare | ||
| </code> | </code> | ||
| Line 97: | Line 117: | ||
| </code> | </code> | ||
| - | ON WORKSTATION | + | ---- |
| + | ==== Creating Your Local git Copy ==== | ||
| + | ---- | ||
| - | > cd /Users/thibaut/Documents/apache2/MAMP_htdocs/osoleil | + | <code> |
| + | > cd /home/<username>/path/to/project | ||
| > git init | > git init | ||
| - | > git remote add web jcarlosd_los_ssh@www.lundiosoleil.com:/var/www/www.lundiosoleil.com/private/website.git | + | > git remote add <staging> <gituser>@my.server.tld:/home/git/<git-projects>/<project-name.git> |
| - | > git add file1 file2 dir/* | + | > git add <file1> <file2> <dir/*> |
| - | > git commit -m "Initial commit" | + | > git commit -m <"Initial commit"> |
| - | > git push web +master:refs/heads/master | + | > git push <staging> +master:refs/heads/master |
| + | </code> | ||
| + | |||
| + | To update an existing remote: | ||
| + | |||
| + | <code> | ||
| + | > git remote set-url <staging> <gituser>@my.newserver.tld:/home/git/<git-projects>/<project-name.git> | ||
| + | </code> | ||
| + | |||
| + | ---- | ||
| ==== Useful Git Commands ==== | ==== Useful Git Commands ==== | ||
| + | ---- | ||
| It isn't in the scope of this article to help you learn Git, although here are a few commands that prove themselves useful in the course of my development experience | It isn't in the scope of this article to help you learn Git, although here are a few commands that prove themselves useful in the course of my development experience | ||
| <wrap todo>TO BE COMPLETED</wrap> | <wrap todo>TO BE COMPLETED</wrap> | ||
