RELATED TAGS git, local, directory, server, remote, repository
QUESTIONS
How can I put my local directory on a git server?
Can I start a repo from local disc?
Is there a way to use an existing project to start as repo?
LINKS Git Init Git From LocalOpen CMD
Open your CMD/terminal and navigate to the direcotry.
cd{path/of/project} Initialize Git
If the project is not already a git project, you need to "initialize" it and create a first commit.
Set Server
This tells git that this project has an online server (remote) that you call "origin".
In the command bellow, you would take for "GIT-USERNAME" the git user created on the server and for
"SERVER-ADDRESS" the address of the server.
Note: If the server is connected through ssh and a special SSH key (and name) for this server was
defined on your local computer, check your local SSH configuration.
If you have the correct address, type:
path/of/project:$gitremoteadd origin{GIT-USERNAME@SERVER-ADDRESS:PATH/TO/PROJECT.git}
If you mispelled the addres or don't like it, you can also change the remote address later.
Set Branch Name
Tell git now which branch you want to take, in new projects it typically would be "main".
Only if the repository already has a "main" branch, this step can be skipped.
path/of/project:$gitbranch-Mmain
Upload to Server
Evertyhing is ready to upload to the server
path/of/project:$gitpush-u originmainAPP | VERSION Linux/Ubuntu
RELATED TAGS git, local, directory, server, remote, repository
QUESTIONS
How can I put my local directory on a git server?
Can I start a repo from local disc?
Is there a way to use an existing project to start as repo?