====REPO LINK==== https://github.com/thanusri7012/24MCR115

PUSH THE DOCKERFILE INTO GITHUB :

# Step 1: Create and switch to a new feature branch from 'main'

git checkout main -b feature1-24MCR115

  • This creates a new branch called feature1-24MCR115 and switches to it. Always create a new branch for a feature to keep main clean.

# Step 2: Check branches

git branch

  • This lists all local branches. The * indicates your current branch.

# Step 3: Check current file changes

git status

  • This shows:
  • You're on branch feature1-24MCR115
  • You have untracked files: Dockerfile, some images (d1.jpg, d2.jpg, etc.), and a .webp file
  • These are not staged yet.

# Step 4: Add all files to staging area

git add .

  • This adds all untracked and modified files in the current directory recursively to staging. It's shorthand for git add for each file.

Image description

✅ Git Commit & Push Workflow

Step 1: Committing the Changes

git commit -m "Added docker file successfully"

  • This command commits the staged changes with a message describing the update.

Output:

[feature1–24MCR115 f3d70da] Added docker file successfully

Indicates a successful commit with the commit hash.

Shows that Dockerfile was created and 18 lines were added.

Step 2: Pushing the Feature Branch to Remote

git push origin feature1–24MCR115

  • This pushes your local branch feature1–24MCR115 to the remote repository.

Output:

Git compresses and uploads your commits.

Confirms successful push:

Image description

Image description