Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:48:17+00:00 2026-05-27T17:48:17+00:00

Goal: Add a new file to a remote git repository without checking the whole

  • 0

Goal: Add a new file to a remote git repository without checking the whole thing out locally.

Why:
I’m building an app that will add files to a user’s git repository. Some of these repositories will be hundreds of megs. Some will be touched very infrequently. I want to avoid taking up terabytes of disk space to keep large repos checked out that won’t be touched often, and I don’t want to incur the inevitable delay of checking out a 200Mb repo (lots of binary files) in order to add a new one new file to it and push that file back to the origin.

I’m assuming the default git client can NOT do this, but am hoping that someone has written something that can commit to a remote repo (don’t care what language) without having the whole thing checked out locally. Does the Cloud9 IDE do something like this?

The app would have full access to the users git repo, either via SSH or whatever mechanism GitHub uses for oAuthed apps to tweak repos.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:48:18+00:00Added an answer on May 27, 2026 at 5:48 pm

    WARNING: THE FOLLOWING ANSWER NO LONGER WORKS WITH THE MOST RECENT VERSIONS OF GIT

    (I’m open to suggestions as to how to make this work with current git versions.)

    The answer, it turns out, is amazingly simple, and a testament to just how awesome Git is.

    • Create a brand new git repo.
    • add and commit the new files to it.
    • tell the new repo where the remote repo is (git remote add … )
    • push to the remote repo.

    Notes: The remote repo must either be a bare repo or have receive.denyCurrentBranch set to “ignore” or “warn”

    This is based on the assumption that the files you are adding are NEW and will not conflict with any other file in the repo.

    The existing contents of the remote repository do not matter so long as you can be sure you’re not going to conflict with anything.

    P.S. Thank you to everyone who posted the potential workarounds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on this app to gather some file/folder usage data. The goal is
My goal is to maintain a web file server separately from my main ASP.NET
I have a PHP web app located on shared hosting . My goal is
My goal is to encode a file and zip it in a folder in
I just recently started a new personal project, with a goal of having it
Meet Jimmy. He has made his new life goal to prove that Chocolate is
My goal I would like to let browsers cache my whole website, but only
My goal is to add different Controls/UserControls in a WPF ListView. The Controls can
Goal: Add the name (the name that has even number in the arraylist )
For my data structures project, the goal is to read in a provided file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.