Difference between revisions of "Git -- new repository setup"

From One-Eyed Man Wiki
Jump to navigation Jump to search
(Comment)
m
Line 2: Line 2:
Note that the URL in my case is defined via ~/.ssh/config. I write it directly into .../[repo]/.git/config.
Note that the URL in my case is defined via ~/.ssh/config. I write it directly into .../[repo]/.git/config.


On server:
On server, as user git:
  <code>mkdir my_project.git
  <code>mkdir my_project.git
  cd my_project.git
  cd my_project.git

Revision as of 02:51, 27 April 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]