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 8178959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:53:35+00:00 2026-06-06T23:53:35+00:00

I have a repository with a sqlite development database along side the code. Any

  • 0

I have a repository with a sqlite development database along side the code. Any interaction with the application tends to update the database, because that’s where sessions are stored. Frequently when switching branches, the developer must either reset or commit the sqlite file before switching.

For example:

>git checked branch2
error: Your local changes to the following files would be overwritten by checkout:
    sqlite3.db
Please, commit your changes or stash them before you can switch branches.
Aborting

>git checkout sqlite3.db
>git checked branch2
Switched to branch 'branch2'

This is a small but annoying problem. I would like to be able to tell git to simply do this for me when switching branches, assuming that this single file is the only thing that has changed.

Of course, I still want to be able to check-in changes to this file when there are other files to commit as well.

  • 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-06T23:53:36+00:00Added an answer on June 6, 2026 at 11:53 pm

    Check out to your desired branch with git checkout --force my_branch:

    -f, --force
           When switching branches, proceed even if the index or the working tree differs from HEAD. This is used to throw away local changes.
    

    This removes any changes in those files but lets you manually commit them should you want to do that prior to checking out into a different branch.

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

Sidebar

Related Questions

We have a repository of common code on svn that we use for many
In my design, I have Repository classes that get Entities from the database (How
I'm using Visual SVN on my Windows Box. I have Repository Application , which
I have a repository class that inherits from a generic implementation: public namespace RepositoryImplementation
I have a repository that looks something like this: foo/ subrepo/ a_file_in_subrepo another.ext unrelated_file
I have a database and a C# class library which acts as a repository
I am in the process of developing a desktop application that needs a database.
I have a repository on github and i want a tool that produces a
I have a git repository, and a very old patch (made in 2007) that
I have a Ruby 1.8.7 application that works correctly locally. To load it on

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.