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

  • SEARCH
  • Home
  • 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 8535825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:31:27+00:00 2026-06-11T10:31:27+00:00

so I re-installed my OS, and now I am facing a git dilemma. I

  • 0

so I re-installed my OS, and now I am facing a git dilemma.

I have an existing git repo on the web which has some things I have changed specifically because they weren’t working with my server yadda yadda etc etc..

I now have a very similar repo but with quite a few core changes, here’s what I need to know how to do:

I want to re-initialize the repo to use my new folder but yet overwrite the different files on the server. My folder has no .git in it, so I will need to make one, but how do I overwrite my changes on to an existing git repo online?

Is it close to git push –force?? but how would I init the same repo into this folder without cloning (something I don’t want to do since I don’t want to overwrite my changes)

Thanks!

  • 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-06-11T10:31:29+00:00Added an answer on June 11, 2026 at 10:31 am

    The natural thing (for me at least) to do here is to have these modifications in a new commit, keeping history of your project. There’s no need to push –force!

    To do so, you must first clone your repo back to the local machine, but in a different directory so that it doesn’t overwrite.

    git clone git://myrepo.com clonedrepo
    

    Then copy the “working copy” in your local repo:

    cp -r workingdir clonedrepo
    

    If you have deleted files in workingdir, you’ll have to delete them by hand on the destination directory. Finally stage and commit:

    git add . && git commit -m "details on what changed"
    

    You’ll be able to push normally since no history was rewritten.

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

Sidebar

Related Questions

I installed RVM on OSX and now my $PATH variable is totally changed. I
I have installed SQL Server 2005 three times now on the same box. I
We have now installed Agilo to manage our Scrum projects, and we have that
I am facing a problem with installing tomcat. I have a xampp server which
I have cognos8.4.1 installed. I have authentication defined(LDAP). Everything was working fine, now suddenly
What I have installed until now is: Latest JDK and JRE (version 7 update
I have installed the release version of PowerShell v3 and am having some trouble
I have a rails 2.3.8 app. I just installed RVM, and apparently things are
I have installed Android SDK on my MAC OS X 10.6 and facing lots
I have a lightbox script installed and now I want to apply the script

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.