Difference between revisions of "Git -- new repository setup"
Jump to navigation
Jump to search
m |
|||
Line 3: | Line 3: | ||
On server, as user git: | On server, as user git: | ||
<code>mkdir my_project.git | <code> | ||
mkdir my_project.git | |||
cd my_project.git | cd my_project.git | ||
git --bare init</code> | git --bare init | ||
</code> | |||
On client: | On client: | ||
<code>mkdir my_project | <code>mkdir my_project |
Revision as of 22:19, 9 September 2023
Note that the URL in my case is defined via ~/.ssh/config. I write it directly into .../[repo]/.git/config.
On server, as user git:
mkdir my_project.git
cd my_project.git
git --bare init
On client:
mkdir my_project
cd my_project
touch .gitignore
git init
git add .
git commit -m "Initial commit"
git remote add origin youruser@yourserver.com:/path/to/my_project.git
git push origin master
[https://stackoverflow.com/questions/2337281/how-do-i-do-an-initial-push-to-a-remote-repository-with-git]