# Git Manage Remotes

### Tasks

* Navigate to the `/usr/src/kodekloudrepos/media` directory.
* Add a new remote named `dev_media`pointing to `/opt/media.git` using Git.
* Copy the file `/tmp/index.html` into the repository.
* Add the copied file to the staging area and commit it to the master branch.
* Push the master branch to the new remote `dev_media`.

### Steps

{% stepper %}
{% step %}
ssh to storage server

```
ssh natasha@ststor01
```

{% endstep %}

{% step %}

### get su access

```
sudo su -
```

{% endstep %}

{% step %}
Navigate to the `/usr/src/kodekloudrepos/media` directory.

```
cd /usr/src/kodekloudrepos/media
```

{% endstep %}

{% step %}
Add a new remote named `dev_media` pointing to `/opt/xfusioncorp_media.git` using Git.

```
git remote add dev_media /opt/xfusioncorp_media.git
```

{% endstep %}

{% step %}

### Copy index.html to current path

```
cp /tmp/index.html .
```

<figure><img src="https://3155059101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftpxp8dhlubc3j58Iygn5%2Fuploads%2FxoTz8xsDwzj0S802Irn6%2Fimage.png?alt=media&#x26;token=5262a7d5-bd9d-4e1f-94af-0e084e06633c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add, Commit and Push index.html to master

```
git add index.html
git commit -m "add index.html"

```

<figure><img src="https://3155059101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftpxp8dhlubc3j58Iygn5%2Fuploads%2FTQlrRXTRmh0LioJLDe6j%2Fimage.png?alt=media&#x26;token=ae54272f-a89a-40a9-ae3a-6f3bfb1a45fa" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Push master branch to dev\_media

```
git push dev_media master
```

<figure><img src="https://3155059101-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftpxp8dhlubc3j58Iygn5%2Fuploads%2FeoHgrSy9CDG3mSO4FLEQ%2Fimage.png?alt=media&#x26;token=724643d9-3ef0-4308-9dc2-50cf2078efb6" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
