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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:03:11+00:00 2026-05-25T03:03:11+00:00

I have two projects. One is the official project and the second is a

  • 0

I have two projects. One is the “official” project and the second is a light modification (some files added). I created new branch and I put new files to them. But in during development some files common to both branches is changed.

How do I commit only these files?

  • 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-25T03:03:12+00:00Added an answer on May 25, 2026 at 3:03 am

    I suppose you want to commit the changes to one branch and then make those changes visible in the other branch. In git you should have no changes on top of HEAD when changing branches.

    You commit only the changed files by:

    git commit [some files]
    

    Or if you are sure that you have a clean staging area you can

    git add [some files]       # add [some files] to staging area
    git add [some more files]  # add [some more files] to staging area
    git commit                 # commit [some files] and [some more files]
    

    If you want to make that commit available on both branches you do

    git stash                     # remove all changes from HEAD and save them somewhere else
    git checkout <other-project>  # change branches
    git cherry-pick <commit-id>   # pick a commit from ANY branch and apply it to the current
    git checkout <first-project>  # change to the other branch
    git stash pop                 # restore all changes again
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two projects, one project loads files from the project folder, one project
I have two projects within one solution. Both projects contain some files that are
I have a solution with two projects. One for project for the production code
I have a solution that contains two projects. One project is an ASP.NET Web
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
I have created two projects. The first one, extracts information of handset and shows
I have two projects which the RestKit framework . One project works without problems
All of my cross-platform libraries are created with solutions that have two projects: one
In my open-source Cocoa project, I have two Xcode projects -- one framework and
i have two projects in eclipse and i want to copy some files from

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.