Skip to content

aditya-nv-06/Git-task4-intern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Task 4: Git Branching and Workflow

This repository is a practical demonstration of common Git workflows for feature development, teamwork, and merging strategies. The task guides you through the creation and management of branches for proper version control and collaboration.

Task Objectives

  • Create and switch between multiple branches.
  • Make and merge changes across branches.
  • Simulate individual contributions in a team workflow.
  • Resolve potential merge conflicts.

Steps and Commands

1. Repository Setup

# Clone the remote repository
git clone <repo-url>
cd <repo-name>

2. Branch Creation

# Create a feature branch and switch to it
git checkout -b feature

# Create a dev branch and switch to it
git checkout -b dev

3. Making Changes

  • Edit/add files on dev and feature branches.

This commit is from the dev branch

This commit is from the feature branch

# Stage and commit changes
git add .
git commit -m "your commit message"

4. Pushing Branches

# Push your branches to the remote repository
git push origin dev
git push origin feature

5. Merging Workflow

  • Merge changes from feature branch into dev branch.
git checkout dev
git merge feature
  • If there are merge conflicts, resolve them in the files, then:
git add .
git commit -m "Resolve merge conflicts"

6. Final Merge to Main

  • After development is complete, merge dev into main:
git checkout main
git merge dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published