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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:33:07+00:00 2026-05-28T07:33:07+00:00

I am new to git and I would like to know how to tackle

  • 0

I am new to git and I would like to know how to tackle a very basic scenario. I read so many posts on stackoverflow about git but still can’t figure out the answer.

We have an origin/master remote branch that everybody is working on.
I have a featureA that I want to implement and might take time to develop. Meanwhile, people might be checking in code to the origin/master.

What would my workflow look like and how should I go about setting up my git branch, given the following needs:

  1. I want to be able to commit code changes to my branch and push them to a remote branch on our server so I don’t loose the changes in case my computer is fried.

  2. I want to keep my branch up-to-date with the master branch.

  3. I want to minimize regular merges. I like to concept of git rebase so I would like to maximize its use and hence fast-forward merges.

  4. At some point we will have to merge my branch FeatureA into origin/master.

Summarizing:

How do I setup a branch that pulls from origin/master but pushes to origin/MY-BRANCH?

What would my workflow look like?

UPDATE:

Thank you @will-pragnell! What is the difference between your solution and the following.

This page on github suggest:

https://github.com/diaspora/diaspora/wiki/Git-Workflow

In order to get the latest updates from the development trunk do a one-time setup to establish the main GitHub repo as a remote by entering:

$ git remote add upstream git://github.com/diaspora/diaspora.git
$ git fetch upstream
$ git checkout master
$ git rebase upstream/master
$ git checkout 100-retweet-bugfix

[make sure all is committed as necessary in branch]

$ git rebase master
  • 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-28T07:33:07+00:00Added an answer on May 28, 2026 at 7:33 am

    You probably don’t want a branch that pulls from master and pushes to your own branch. What you want is to pull from master on to your local master, handle rebasing locally, and then push to your own remote branch for the feature. This is a fairly standard workflow and gives you complete control and a minimal amount of merging. Personally I would do it like this:

    Create a new local branch

    git checkout -b myFeature
    

    Push that to a new remote branch (see this stackoverflow question if you need more info on this step)

    git push origin myFeature
    

    Now you can work away hapily on the myFeature branch, pushing using the above command when you need to without messing up the master branch. When you need to get hold of commits that others have done on master, you can do so like this:

    git checkout master
    git pull (this will just fast-forward if you don't make any local changes to master)
    git checkout myFeature
    git rebase master
    

    When your feature is finished, you can the merge or rebase your branch back in to master so that everyone else gets your new feature. Like this:

    git checkout master
    git merge myFeature
    git push origin master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Git and I would like to know how to move a
I would like to know if the following is possible in git: Suppose I
I would like to know the preferable way to move all my git repositories
I am very new to git, I checked couple of similiar questions, but, the
I am very new to git. I have a .gitignore in the my working
I'm very new to git. I wanted to create a repository named Common-Lib, below
I am new to Git and I seem to have one branch too many
I would like to know how you normally deal with this situation: I have
We have a non-standard subversion respository that we would like to convert to Git.
Does anyone know of a way to get numerous read-only git repositories based off

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.