How to give git repo a name?

Hey guys i'm new to git now i'm doing a remote repo with this command

mkdir NewRepo cd NewRepo git init 

and

Then I clone this repo to local

 git clone user@server :/path/to/app/.git 

This worked for me, but I want to give the repo a name, do something like the rest:

 git clone user@server :/path/to/app/reponame.git 

Can I tell you how to do this, thanks

+7
source share
3 answers

You can create a git repository directly in a folder without a .git subdirectory. To do this, you do the following:

 mkdir myrepo.git cd myrepo.git git init --bare 

This is called an open repository - it contains the contents of what is usually found in the .git folder. He does not have a working copy. These types of repositories are typically used on a remote server (where you push your changes); that is, when your remote repository basically reflects what you did locally, and no one works directly with the code at the remote server location (so there is no need for a working copy.)

More details:

+12
source

The name is listed in the directory as mentioned above, although it does support a description for software such as gitweb:

 echo "Happy description" >.git/description 
+10
source

The repositories have no names, you just use the name of the folder (I suppose you could name the folder "app.git":

 git clone user@server :/path/to/app 

Remotes have names, for example. "origin" or whatever. It depends on the client, but is not a property of the remote repository.

 git remote add origin user@server :/path/to/app 
+3
source

All Articles