Git workflow VisualStudio - intive/patronage21-qa GitHub Wiki

Git workflow - VisualStudio

0. Prerequisites

Git -> Clone Repository...

Git -> Clone Repository

Fill remote 'Repository location' and your local 'Path'
Fill remote 'Repository location' and your local 'Path'

Git -> Settings

Git -> Settings

Rebase local branch when pulling = True
Rebase local branch when pulling = True

1. Create branch for a new feature

Git -> Manage Branches

Git -> Manage Branches

master -> New Local Branch From...

master -> New Local Branch From...

Branch name: feature/feature-name

Branch name: feature/feature-name

2. Code/Do_your_stuff -> commit

Git -> Commit or Stash...

Git -> Commit or Stash...

Select files and add commit message
Select files and add commit message

3. (Frequently) Check for new changes on the remote repository

Pull changes from remote

master -> Checkout
master -> Checkout

master -> Pull
master -> Pull

feature/feature-name -> Rebase 'master' onto 'feature/feature-name'
feature/feature-name -> Rebase 'master' onto 'feature/feature-name'

feature/feature-name -> Checkout
feature/feature-name -> Checkout

No conflicts

Case 1 - Already up to date
Already up to date

Case 2 - Downloading changes without conflicts
Downloading changes - master

Downloading changes - feature/feature-name

Conflicts

Conflict

[C] Conflict

C like Conflict

Resolve conflicts in VisualStudio

Resolve conflicts in VisualStudio - before

Resolve conflicts in VisualStudio - after

Rebase - Continue

Rebase - continue

Rebase - success

4. When feature is finished -> squash

Git -> Manage Branches

git status - 3 commits

Select commits -> Squash Commits...

Select commits -> Squash Commits...

Commit message before editing
Commit message before editing

Changed commit message
Changed commit message

Squashed commits

5. When feature is finished -> push

Git -> Push

feature/feature-name -> Push

Git -> Push - success

6. Pull request

Create a pull request in accordance with the guidelines on: Branching policy

Select the appropriate base branch

Create Pull Request

Correct branches

7. Merge

When your pull request is approved by the appropriate number of people, do the merge according to the guidelines on: Branching policy

8. Delete useless branch

Remote branch

Delete branch after merge

OR

Standard way to delete remote branch step1

Standard way to delete remote branch step2

Local branch
master -> Checkout

master -> Checkout

master -> Pull

master -> Pull

master -> Pull - success

feature/feature-name -> Delete

feature/feature-name -> Delete

feature/feature-name -> Delete

⚠️ **GitHub.com Fallback** ⚠️