Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github repo name and local folder name for repo

Tags:

git

github

I have stored my app sources (git repo) in folder:

MyProject/front_app

But on GitHub I want to have the repo named not front_app but rather my_project_front_app, is it possible to do?

Is it a good approach or it is better to have local folder my_project_front_app for this git repo?

like image 384
WHITECOLOR Avatar asked Aug 21 '12 19:08

WHITECOLOR


2 Answers

You can do what you want. The local and the remote repository can have different names.

If you already have a local repository, you can add a remote (named as you want) with:

git remote add origin http://distant/a_remote_repository

If you already have a GitHub repository, you can clone it in the local folder you want with:

git clone http://distant/a_remote_repository a_different_local_folder
like image 76
Benoit Courtine Avatar answered Sep 23 '22 08:09

Benoit Courtine


There is no reason the GitHub repository, your local clone, and any other copy of the code couldn't be named differently. There's no real advantage or disadvantage to it, other than you and your collaborators' ability to keep it straight.

git clone <url> <path> ;# path is a variable; it's the url that's well-defined
git remote add <name> <url> ;# as can be seen in the 'git remote add' command
like image 20
Christopher Avatar answered Sep 26 '22 08:09

Christopher