문제

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

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top