6

Connect a local version of the project with Github

 3 years ago
source link: https://www.codesd.com/item/connect-a-local-version-of-the-project-with-github.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Connect a local version of the project with Github

advertisements

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).


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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK