shreyansh goel
shreyansh goel

Reputation: 229

Clone a Git repository with another name

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?

Upvotes: 20

Views: 18955

Answers (3)

smarber
smarber

Reputation: 5074

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.

Upvotes: 8

Ankit Jain
Ankit Jain

Reputation: 1036

Clone the repository in this manner:

git clone clone_url.git project_name

Upvotes: 14

Vampire
Vampire

Reputation: 38619

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.

Upvotes: 30

Related Questions