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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:38:51+00:00 2026-06-01T09:38:51+00:00

I have a Git repository which I have started to develop on master branch

  • 0

I have a Git repository which I have started to develop on master branch in and now I believe that master shouldn’t be a long running branch. As others, I think master branch always holds the stable product.

So, I would like to open a new branch named develop and that branch will be a long running development branch but I am not sure what would be the best approach to switch here. My current solution is this:

Open up the new branch and push it to GitHub:

git checkout -b develop
git push origin develop

Then get back to master branch and stop tracking all the files except for README.md and push it to remote repository (GitHub, in this case):

git checkout master
git rm . --cached -r
git add README.md
git commit -m "cleaned up the master branch"
git push origin master

What are your thoughts?

  • 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-01T09:38:52+00:00Added an answer on June 1, 2026 at 9:38 am

    Your problem is with the NAME “master”.

    A branch is a branch. None of them is really more important than any other. The name is literally just a tag–a string that identifies the current HEAD, and bumps along as that HEAD is committed on top of. But a branch’s “master”-ness is only important because that’s the name git gives the first branch it creates in a project. But that’s just a name. Let’s take your current master branch and give it a new name. Since what you call it is irrelevant, let’s choose “steve”.

    git branch -m master steve
    

    Great. Now you HAVE no master branch! But you have the old steve branch that has historical work in it. That’s worth having around, but because you’re drawing a line in the sand in the history right now, you’ll likely never dip back into it.

    So then check out your dev branch, work on it, etc. And when it’s stable (whatever that means in your particular case), create yourself a NEW master

    git checkout -b master
    

    Ha ha! First commit on that master branch is stable, and you can make sure all future commits are too! (BTW you’ll want –no-ff on all merges from devel into master, to keep those intermediate potentially nonstable commits out of your shiny new “master” branch.)

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

Sidebar

Related Questions

I have a Git repository which contains a number of subdirectories. Now I have
I have a Git repository with 'master' branch. Some time ago (few months), we
I have a git repository which contains (among others) *.wse text files and *.sh
I have a git repository, which has changes that I am slowly bringing into
We have a git repository which contains source for a few related Java WARs
I have just one cs file in my repository which Git seems to think
I have a git repository (at github.com) with two branches: master and gh-pages. I
I have a central git repository that everyone pushes to for testing and integration,
I have a remote git repository and I have cloned one branch git clone
I have a git branch on my production server which is centos. I am

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.