Connect a local version of project with Github

Scenario:

I manually downloaded a zip of a file (a web app) that I am using locally. I want to start pushing some fixes. I don't want to have to download the entire project again (low bandwidth, expensive internet)

So, is there anyway to connect the local project to Git repository and have it use my local version as the base (adding the relevant changes, if any, of course).

Answers


You can use git clone and get it to point to a local copy of the repository (assuming your downloaded zip file is a git repo)

From the git manual:

git clone --reference <repository>

If the reference repository is on the local machine, automatically setup .git/objects/info/alternates to obtain objects from the reference repository. Using an already existing repository as an alternate will require fewer objects to be copied from the repository being cloned, reducing network and local storage costs

git clone --depth 1

If you only wanted a shallow clone of a remote repo (let's say you just want to patch HEAD and submit), this would save on bandwidth by only cloning the recent history.


Locate the folder of the project, then add this project from the client, in e.g. from windows client. When you add that repository, the client should check the files and if they are exact copies, it should not download again.


Need Your Help

jQuery: How to get the key TAB event on an input element?

jquery keyup keystroke

I try to triffer a button when in an input field the return key has been hit. This works. But if I hit the tab key nothing is triggered because the TAB key event isn't captured.

How to check user email uniqueness and pass result to jQuery?

jquery ruby-on-rails ruby validation

I have this problem : I'm checking user email in controller and sending json successfull response if it is already taken and add css styling of input, also I need to prevent submit and add some mes...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.