S
S
sawa42017-07-28 21:44:48
linux
sawa4, 2017-07-28 21:44:48

How to upload a project to the server via git?

There is a backup copy of the project from the server, downloaded physically via FTP. There are 2 branches if you open the git console (Git Bash Here) And write git branch, you can see two branches master and production.
The question is how to actually upload the project so that these two branches are also on the server?
I do on the server git init
locally set up remote access to the server

git remote add origin ssh://[email protected]/var/www/myproject.com

then I commit and push
git add ./
git coomit -m 'master'
git push -u origin master

I enter the SSH password from the user and voila:
* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Everything seems to be correct, but physically the files do not appear on the server, what could be the matter?
If you upload files via FTP, then all branches are visible but they do not switch between themselves, I do stash and the floor of the project disappears

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Eremin, 2017-07-28
@divanus

git remote add origin ssh://[email protected]/var/www/myproject. git

S
sawa4, 2017-07-30
@sawa4

Revealed another "unknown"
After doing the above

* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

and did it locally in another directory
git init
git remote add origin ssh://[email protected]/var/www/myproject.com
git pull origin master
I have downloaded the master that I pushed, BUT which is not physically on the Debian server
ls -al shows .git and that's it, there is nothing via ftp either, and the site, accordingly, does not open because there is not a single file physically there.
QUESTION: where did git download this for me?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question