You are on page 1of 1

Start

If two people
are working on
the same
For New feature checkout to new branch feature the
branch name
should be
$ git checkout -b <FEATURE_NAME> same.

ALWAYS START
WORK IN NEW
Make changes and once all the changes are done add BRANCH AND
all files to staging and commit NEVER IN
MASTER

if we have made changes


in front end then build files in production
Environment before commiting

yes

$ npm run prod No

$ git add .
$ git commit (Enter detailed message)

if we haven't pushed the changes


to remote repo and we want to reduce
number of commits

Pushed
$ git commit --amend

there are some more changes

Once you are


Checkout to Master Branch ready to push
changes to remote

$ git checkout master

Pull the changes from remote to update local repo

$ git pull

Checkout to the feature branch which we want to push


to the remote repo

$ git checkout <FEATURE_NAME>

If remote feature branch is updated


then first pull those changes yes
into your local feature branch.

$ git pull origin <FEATURE_NAME>


No

Push this branch to the remote repo


with upstreaming

$ git push -u origin <FEATURE_NAME>

In bitbucket create a pull request for this branch

Repeat

if there are no conflicts and no errors then


No Yes
pull request will be approved

feature branch will be merged with Master

Else Pull request will be declined

Automatically * $ git checkout master


commit will * $ git pull
reflect in pull * $ git pull --no-ff origin <FEATURE_NAME>
request no * $ git push -u origin master (-u only for the first time)
Make require changes and commit and push it to need to create
remote branch pull request

Delete sub Branches once it is merged into master

To delete remote branch

$ git push origin :<branch_name> (REMOTE BRANCH)

To delete local branch

$ git branch -d <BRANCH_NAME>

After deleting sub Branches run

$ git fetch --all --prune (To delete tracking of remote


branch from local)

End

You might also like