Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push Git Project to Local Directory

Tags:

git

github

Don't know whether this is fully supported in Git would be excellent if it is as it could make things a lot easier, basically I have a project am working on in folder X and when I get it to a particular stage I want to push it to folder Y on my computer again.

If this is possible great, what would be evener better is whether it is possible with either GitHub for Mac or Tower for Mac.

like image 567
Aran Avatar asked Aug 07 '11 23:08

Aran


People also ask

Can git push to local repository?

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.

How do I push a file to a local repository?

On GitHub.com, navigate to the main page of the repository. Above the list of files, using the Add file drop-down, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree.


1 Answers

It is absolutely possible - what you probably want to do is create a "bare" git repository in folder Y (git init --bare) and then add that file location as a remote:

git remote add Y file:///path/to/Y 

I assume GitHub for Mac or Tower for Mac would handle this like any other remote.

like image 71
dahlbyk Avatar answered Sep 22 '22 02:09

dahlbyk