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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:42:31+00:00 2026-06-12T23:42:31+00:00

noob to git: expanding on this question a little I created a repository and

  • 0

noob to git:
expanding on this question a little

I created a repository and committed my README.md to the master branch.
My local folder structure is:

projectName  
 --README.md  
 -- + part1  
 -- -- README.md  
 -- -- + src  
 -- + part2  
 -- + ...  

I initialized git init in the projectName folder and was able to make the commit.

Then I do git checkout -b part1.
cd .\part1 and git add .\README.md .\src

When I commit and push git push -u origin part1 and check my repository my master branch has all the files from part1 and the part1 branch has correct files but it contains the README.md from the master branch.

After I ‘remove’ the master README.md I want to commit from branch part1 the files/folders in my local part1 folder. The problem I am having with this is when I commit the actual folder part1 shows up in the part1 branch. I just want the contents to show up.

EDIT_1
I want to create multiple branches. After committing to the master branch I do this:
git checkout -b part1
When I commit from part1 I don’t want the README.md from the master coming along for the ride. Doing git rm README.md deletes the file from my local directory.

UPDATE
I was confused about the second part of my own question. @willoller clarified.

  • 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-12T23:42:34+00:00Added an answer on June 12, 2026 at 11:42 pm

    Use the following command git checkout -b new_branch to create a new branch from current branch.

    So you created your part1 from master and your README.md was copied from master.

    “-u” creates a relation with remote branch.

    If you want push your branch to remote host, you could just use git push origin my_branch.

    To delete files from branch use git rm and commit the changes afterwards.

    I hope I’ve helped.

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

Sidebar

Related Questions

Noob here.... I cloned a git and then created a new branch in it.
Noob question here! I have an array with hashes that looks like this: arr
I'm new to git so it might be a noob question. I'm working in
Noob question. I have this: Array ( [0] => address = 123 Something Street
Noob question. Setting array elements throws an error. I get this error when I
Noob question here, my basic setup looks like this: (function($) { $.fn.imageSlider = function(options)
This is probably quite simple but I'm currently a git noob and haven't quite
Git noob here. I know this is against the principal of distributed source control
Noob question alert! So, I've got this script, which loops through an array and
a noob question here! I wrote this query, but the group by is very

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.