0% found this document useful (0 votes)
4 views2 pages

Git Workflow Guide

This Git Workflow Guide outlines essential commands for initializing a project, configuring user identity, checking status, staging and committing changes, branching, merging, and setting up remote repositories. It also includes instructions for updating the project and undoing mistakes, as well as stashing work temporarily. Each step is accompanied by the relevant Git command for execution.

Uploaded by

mullaimtiyaj76
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Git Workflow Guide

This Git Workflow Guide outlines essential commands for initializing a project, configuring user identity, checking status, staging and committing changes, branching, merging, and setting up remote repositories. It also includes instructions for updating the project and undoing mistakes, as well as stashing work temporarily. Each step is accompanied by the relevant Git command for execution.

Uploaded by

mullaimtiyaj76
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

■ Git Workflow Guide

1■■ Initialize Project


git init
Start tracking your folder with Git.

2■■ Configure Identity


git config --global [Link] "Your Name"
git config --global [Link] "your@[Link]"
Set your name and email for commits.

3■■ Check Status


git status
See which files are untracked, modified, or staged.

4■■ Stage & Commit


git add .
git commit -m "Initial commit"
Stage and save snapshots of your code.

5■■ Branching
git branch feature-1
git checkout feature-1
Create and switch to a new branch for changes.

6■■ Merge Changes


git checkout main
git merge feature-1
Bring branch changes into main project.

7■■ Remote Setup


git remote add origin
git branch -M main
git push -u origin main
Connect to GitHub and push code.

8■■ Update Project


git pull origin main
git push origin main
Keep project updated with remote.
9■■ Undo Mistakes
git restore
git reset
git reset --hard HEAD
Undo unwanted changes safely.

■ Stash Work
git stash
git stash pop
Save work temporarily and restore later.

You might also like