start new feature with git

Table of Contents

start a new feature with git is:

  1. [optional] start a new branch
    1. make new local branch, from starting point(e.g. main), and switch to it

      git branch main
      git branch new-feature
      git checkout new-feature
      

      magit: b l (magit-branch-checkout) new-feture main

  2. stage, commit and push on that branch to make that new feature
  3. [when in collaboration/when doing multiple features the same time] when somebody else’s work/some other feature is done, and you’d like to use it in the feature/see compatibility, pull() them.

    git fetch origin # if with remote repo and somebody else's working on it
    git checkout new-feature # make sure you are on the branch with your feature
    git merge another-branch # pull in new commits from another-branch
    

    magit: b b (magit-checkout) new-feature and m m (magit-merge) other-branch

Backlinks

git

Git is a version control tool

Author: Linfeng He

Created: 2024-04-03 Wed 20:16