100 Days of DevOps: Day 26

Updating Git Remote and Pushing Changes

The xFusionCorp development team updated the project repository. A new remote needed to be added and the latest changes pushed to it. The task involved configuring the new remote, adding a file to the repository, and pushing the changes.

Steps Performed

1. Navigate to the repository

cd /usr/src/kodekloudrepos/official

2. Add the new remote

Added a new remote named dev_official pointing to /opt/xfusioncorp_official.git:

git remote add dev_official /opt/xfusioncorp_official.git

Verify remotes:

git remote -v

Output confirms the new remote is configured:

dev_official    /opt/xfusioncorp_official.git (fetch)
dev_official    /opt/xfusioncorp_official.git (push)

3. Copy the required file into repository

Copied /tmp/index.html into the working directory of the repo:

cp /tmp/index.html .

4. Add and commit the file

Staged and committed the new file:

git add index.html
git commit -m "Added index.html file"

5. Push the master branch to the new remote

git push dev_official master

Notes

  • If you want dev_official to act as the default remote for pushes, run:
  git push -u dev_official master

Leave a Reply