Git in the IDE (commit, branch, merge, PR)

Git without leaving the editor

Both Visual Studio and VS Code have built-in Git support. You don't have to switch to the terminal for typical operations — although it's worth understanding what the IDE does under the hood (the earlier path covered the same git commands).

Commit

In VS Code, the Source Control panel (Ctrl+Shift+G) shows changed files. You stage by clicking +, type a message and commit. In Visual Studio the Git Changes window works the same way.

# What the IDE does under the hood
git add src/app/dashboard/page.tsx
git commit -m "feat(dashboard): dodaj widżet MFA"

Tip: Stage deliberately — don't commit "everything". The panel shows the diff of each file; review it before committing so you don't slip in a stray console.log or commented-out code.

Branch

You create a new branch from the status bar (the bottom-left corner in VS Code shows the current branch). Click the branch name → Create new branch. At ProfessNet we follow a naming convention:

Type of workPatternExample
New featurefeature/...feature/mfa-widget
Bug fixfix/...fix/login-redirect
Urgent patchhotfix/...hotfix/csrf-token
git switch -c feature/mfa-widget

Merge and conflicts

When you merge branches, the IDE detects conflicts and opens the merge editor. VS Code shows Current Change (yours) and Incoming Change (from the target branch) with Accept Current / Incoming / Both buttons. After resolving all conflicts you stage the files and finish the merge with a commit.

git switch main
git pull
git switch feature/mfa-widget
git merge main   # resolve conflicts in the IDE, then commit

Pull Request straight from the IDE

With the GitHub Pull Requests extension in VS Code you can create a PR without opening the browser. After pushing the branch, a Create Pull Request button appears — you choose the target branch (main), title and description. Reviewers, comments and the status of CI checks are visible in the panel.

git push -u origin feature/mfa-widget
# then: Create Pull Request in the GitHub panel

At ProfessNet every change reaches main exclusively through a PR — never a direct push. A PR triggers GitHub Actions, and after merge Vercel builds the deploy.

A typical cycle

  1. git switch -c feature/... — new branch.
  2. Work, commit in small steps.
  3. git push — push the branch.
  4. Create a PR from the IDE.
  5. After review and green CI — merge into main.

Summary

Built-in Git in the IDE covers the whole daily loop: commit, branch, merge, PR. Stick to the branch naming convention and the "only through a PR" rule — that ties the team's work to the CI/CD pipeline and Vercel deploys.