Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git without local repository

Tags:

git

Consider the case where (for example) a 20GB directory is stored on a computer with 20.1GB disk space free, and we want to put this directory under revision control. A server is available to store revision history.

In subversion, we checkout an empty directory from the server, add the files, and commit it. This creates .svn directories of approximately the same size as the working directory so that it can detect changes and create diffs. The size of the .svn directories doesn't change over time as you make regular changes.

However, trying this in git (git init .; git add .; git commit) requires that we store the full history locally. As regular changes are made (assume large binary files that don't compress well), the .git directory grows until it doesn't fit on disk.

Is there a way to operate git so that it doesn't store the full history locally; so that it only keeps data about the tip of the branch that you're working on, and queries a remote server every time that it wants information about historical revisions or other branches?

note: I know the .git directory is better compressed and you can make lots of revisions before it gets bigger than the .svn directory - the issue is that it grows over time whereas the .svn doesn't

like image 633
OJW Avatar asked Jan 24 '13 12:01

OJW


People also ask

How do I connect a git repository to Another Git repository?

On Git bash, type in the following commands to connect your local repository to the remote one: The first command will add an origin (a remote repository) to your local Git and the second one will verify the added repository URL. Next, it's time to check and pull all the changes on the remote repository to the local one to get them both aligned.

What happens if you push to an empty Git repository?

… so git will warn you that the repo you’re cloning is empty, but it will do it. The reason it warns you is that if you push to an empty repository, you need to specify which branch you’re cloning to, because there are no branches in an empty repo.

How many developers can work on a git repository?

This is commonly used in development with more than 1 developer working on the same project. What is Git repository used for? II. Create and initialize a Repository III. Clone local Repository using Visual Studio IV.

How to delete a GitHub repository?

Got to GitHub Repository, the one you plan to delete. Click on the ‘Settings’ on top menu. Click on the ‘Delete’ repository button at the bottom of the Settings page. As you modify your local project folder, you need update the GitHub Repsoitory.


Video Answer


1 Answers

Depending on what you want to do, these answers might give you a clue Browse and display files in a git repo without cloning. In general, there are serveral solutions

  • Working with the remote copy if you have ssh access.
  • Using an access API such as the one provided by GitHub.
  • Using "shallow clone": git clone --depth=1
like image 134
jjmerelo Avatar answered Sep 26 '22 15:09

jjmerelo