Git Manage Remotes

Hello,
Can somebody please help me out what am I doing wrong?

xFusionCorp development team was working on a project that is maintained under /opt/media.git repo and same is cloned under /usr/src/kodekloudrepos/media to add updates. Recently some changes were made on Git server that is hosted on Storage server in Stratos DC . Basically DevOps team added some new Git remotes so we need to update remote on /usr/src/kodekloudrepos/media repository as per details mentioned below:

a. In /usr/src/kodekloudrepos/media repo add a new remote dev_media and point it to /opt/xfusioncorp_media.git repository.

b. There is a file / tmp/index.html on same server, copy this file to the repo and add/commit to master branch.

c. Finally push master branch to this new remote origin.

I did the following:

  1. cd /usr/src/kodekloudrepos/media
  2. git remote add dev_media /opt/xfusioncorp_media.git
  3. cp /tmp/index.html .
  4. git init
  5. git add index.html
  6. git commit -m “add index.html”
  7. git push origin master

I got the error:
Seems like required data was not pushed to the new remote ‘dev_news’ on Storage server

I think remote repo already added. You can check git remote list by git remote -v.

It was not added, but I checked when I added it and it was shown.
I think the problem is with my
git push origin master
Because the error I got is
Seems like required data was not pushed to the new remote ‘dev_news’ on Storage server

But you have added your new remote repo dev_media and using default origin i don’t know it’s there or not. You have to use this git push -u dev_media master

1 Like