Git: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
[[setting aliases]] |
|||
⚫ | |||
[[setting global variables]] |
|||
Assuming a project in ~/myproject containing all sorts of files and directories |
|||
[[bash git-prompt]] |
|||
[[branches]] |
|||
<pre> |
|||
In the below example we use a local project called 'myproject' and upload it to the git server. |
|||
- if the existing local 'myproject' isn't initialised with git yet, then do so now: |
|||
$ git init |
|||
$ git add . |
|||
$ git commit -m "initial commit" |
|||
- clone 'myproject' from your local project into a new local directory called 'myproject.git' |
|||
$ git clone --bare myproject/ myproject.git |
|||
- upload the new repository to the remote server |
|||
$ scp -r myproject.git/ git@gitserver:/home/git |
|||
(this will create the folder /home/git/myproject.git on the server) |
|||
you may now clone the repository directly from the server into a local folder |
|||
$ cd somedir |
|||
$ git clone git@gitserver:myproject (the .git extension is not required) |
|||
lastly, you may now remove the original 'myproject' dir locally |
|||
</pre> |