On a server that I’m working, I find that I have Git support. Tired by going with PuTTY to do each commit, I’ll like to clone that repository to my machine and push back only when I’ve done my local work.
how can I find the name of that git repository? On that Linux server I’m a user which has access with FTP and SSH. My web application is public available on the address http://linux_server_IP_address/~linux_user.
You want to know the path to your repository, not the name.
Assuming that your repository is stored under
$HOME/myrepo, you could clone it that way:But cloning via HTTP, you cannot push back changes to the server, so better use the SSH protocol:
See the
manpage ofgit clonefor more information about the different protocols.Note that you won’t be able to push directly to
myreposince it’s not a bare repository. To push tomasteronmyrepo,mastermust not be checked out onmyrepo. To achieve this, go tomyrepo, create a temporary branch (git checkout -b nocommit), thengit push origin master:masterand thengit checkout masteragain.The topic of pushing into a non-bare repository has been discussed several times here: