[Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

8
DEV VIT RA KHƠI CREATING PULL REQUESTS LIKE A PRO

Transcript of [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

Page 1: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

DEV VIỆT RA KHƠICREATING PULL REQUESTS LIKE A PRO

Page 2: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

CREATING PULL REQUESTS LIKE A PRO

A B C D E F upstream/master

origin/master

origin/week1 origin/week2 origin/week3

PR

PR

PR

G H

Page 3: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

CREATING PULL REQUESTS LIKE A PRO

1. Create a “git remote” upstream 2. Keep your master in sync with upstream 3. Create a feature branch, develop 4. Push feature branch and create a PR

Page 4: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

CREATE A “GIT REMOTE” UPSTREAM

CREATING PULL REQUESTS LIKE A PRO

$ git remote -v

$ git remote add upstream https://github.com/DevVietRaKhoi/weekly.git

$ git remote -v

Page 5: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

KEEP YOUR MASTER IN SYNC WITH UPSTREAM

CREATING PULL REQUESTS LIKE A PRO

$ git checkout master

$ git fetch upstream

$ git reset --hard upstream/master

Page 6: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

CREATE A FEATURE BRANCH, DEVELOP

CREATING PULL REQUESTS LIKE A PRO

$ git checkout -b featureX

$ git add abc

$ git commit -a -m’XYZ’

Page 7: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

PUSH FEATURE BRANCH AND CREATE A PR

CREATING PULL REQUESTS LIKE A PRO

$ git push --set-upstream origin featureX

Create a pull request via GitHub web interface

Page 8: [Code2Pro] Create GitHub Pull Requests Like a Pro Using Branches

THAT’S ALL FOLKS!

DEV VIỆT RA KHƠI

For more tips, video & tutorials, check: https://fb.com/code2pro