finding the name of the git repository

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.

Do you know 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 webapp is public available on the address: http://linux_server_ip/~linux_user

  • GIT pulling or cloning repository only gets Master branch
  • Hudson git clone error
  • Keep a commit locally to clone in Git
  • How to clone a git repo with all branches and tags from refs/remotes?
  • Git svn clone: How to defer fetch of revision history
  • Making cloned repository in git the master
  • Why does git fetch via hudson fail, while git fetch via the command line works?
  • Create workflow for a “Global” bower_components folder for all of your projects?
  • Vagrant: install git using Chef
  • Do I have to do one pull request for all commits using GitHub
  • How to use git with dropbox and a usb-stick/thumbdrive
  • Deploying Ghost 0.4.2 to Azure Site using Git Deploy
  • 2 Solutions collect form web for “finding the name of the git repository”

    You want to know the path to your repo, not the name.

    Assuming that your repo is stored under $HOME/myrepo, you could clone it that way:

    git clone http://linux_server_ip/~linux_user/myrepo
    

    But cloning via http, you cannot push back changes to the server, so better use the ssh protocol:

    git clone ssh://linux_user@linux_server_ip/myrepo
    

    See the man page of git clone for more information about the different protocols.

    Note that you won’t be able to push directly to myrepo since it’s not a bare repo. To push to master on myrepo, master must not be checked out on myrepo. To achieve this, go to myrepo, create a temporary branch (git checkout -b nocommit), then git push origin master:master and then git checkout master again.

    The topic of pushing into a non-bare repo has been discussed several times here:

    • Push to a non-bare Git repository
    • Git: making pushes to non-bare repositories safe
    • cannot push into git repository

    The name of the repository is the folder name of the parent folder which contains the repository (since you do your work on that server, it’s the folder, which contains the .git folder). But if there’s a .git folder, it’s not a bare repository, and then push to that repository is very bad practice. You should create a bare repository, and then clone that repository and push to it.

    Git Baby is a git and github fan, let's start git clone.