DEV Community

Wycliffe A. Onyango
Wycliffe A. Onyango

Posted on

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Verify remotes:

git remote -v
Enter fullscreen mode Exit fullscreen mode

Output confirms the new remote is configured:

dev_official    /opt/xfusioncorp_official.git (fetch)
dev_official    /opt/xfusioncorp_official.git (push)
Enter fullscreen mode Exit fullscreen mode

3. Copy the required file into repository

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

cp /tmp/index.html .
Enter fullscreen mode Exit fullscreen mode

4. Add and commit the file

Staged and committed the new file:

git add index.html
git commit -m "Added index.html file"
Enter fullscreen mode Exit fullscreen mode

5. Push the master branch to the new remote

git push dev_official master
Enter fullscreen mode Exit fullscreen mode

Notes

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

Top comments (1)

Collapse
 
sadiul_hakim profile image
Sadiul Hakim

Go on man. I want you to finish this challenge.