In what branch should I be when doing a rebase?

I have a master branch with some commits that the branch development doesn’t have.

The development branch has even more commits that master doesn’t have.

  • Git squash commits with merged branch
  • Delete branches which are not in the local repository using git
  • Is a TFS branch a physical or logical snapshot?
  • Showing which files have changed between two revisions
  • Git - how to delete a branch?
  • GitFlow Unity3D and Branch specific Application Data
  • I want to merge the state of development to master, i.e. override whatever changes master has that development lacks.

    I have been told that I should a rebase. When I read about rebase, I understand that the syntax is the following:

    git rebase master
    

    What I don’t understand though, is from what branch I should write the command (to accomplish the described scenario), in master or in development?

  • Can i do a directory listing with git, displaying latest commit dates
  • Git branch has diverged after rebase, so why rebase?
  • Drawing tidy graphs with shared parents and children
  • Git SSH error: “Connect to host: Bad file number”
  • SourceTree error when switching branch back to master
  • Find the parent branch of a Git branch
  • 2 Solutions collect form web for “In what branch should I be when doing a rebase?”

    In this specific scenario, you would write the rebase command from the development branch.

    This is similar to how git merge master would merge master onto your current branch.

    Checkout development and rebase from there as so:

    git checkout development
    git rebase master
    

    The latter example, git rebase master development is a shorter version of the commands above (as described in the documentation you had linked).

    This will cause your development branch changes to seem as if they started from the latest commit on master (provided you don’t run into any conflicts, which you’ll have to resolve during a rebase if you come across them). If all goes well you will be able to then merge development into master which will act as a simple fast-forward merge.

    See http://rypress.com/tutorials/git/rebasing.html for a good explanation.

    Git Baby is a git and github fan, let's start git clone.