Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clone a Git repository with another name

Tags:

git

git-clone

How can I clone a repository with name myproject?

The server directory is named with a unique code like 584ffceed.git using smart https. How do I set permissions that ask for a username and password and give rights to push or pull?

like image 680
shreyansh goel Avatar asked Feb 10 '17 13:02

shreyansh goel


3 Answers

To clone into myproject just do git clone .../584ffceed.git myproject.

Regarding your other question, it is not really clear what you are asking. Please rephrase the question to make it clear.

like image 186
Vampire Avatar answered Oct 20 '22 21:10

Vampire


From man git-clone:

   git clone [--template=<template_directory>]
             [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
             [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
             [--dissociate] [--separate-git-dir <git dir>]
             [--depth <depth>] [--[no-]single-branch]
             [--recursive | --recurse-submodules] [--[no-]shallow-submodules]
             [--jobs <n>] [--] <repository> [<directory>]

<directory>
           The name of a new directory to clone into.
           The "humanish" part of the source repository is used if no directory is explicitly given (repo for /path/to/repo.git and foo for
           host.xz:foo/.git).
           Cloning into an existing directory is only allowed if the directory is empty.

It's the argument <directory> placed directly after the repository URI.

like image 38
smarber Avatar answered Oct 20 '22 19:10

smarber


Clone the repository in this manner:

git clone clone_url.git project_name
like image 4
Ankit Jain Avatar answered Oct 20 '22 19:10

Ankit Jain