Skip to content

Commit

Permalink
Add how to pull changes from Mate repository guideline
Browse files Browse the repository at this point in the history
  • Loading branch information
TPolina committed Jul 6, 2022
1 parent 4604af5 commit 4c4f665
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
git push origin develop
```
- If you created another branch (not `develop`) use its name instead
Note: if changes were added to GitHub task when you already forked it and
downloaded to your local machine, follow this
[guideline](./pull-changes-from-mate-repo-guideline/pull-changes-from-mate-repo-guideline.md) to pull changes.
## Create a Pull Request (PR)
1. Open your repo on GitHub and create a `Pull Request` (PR)
![New PR button](./assets/new-pull-request-button.png)
Expand Down
Binary file added assets/link-to-mate-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/remote-list-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/remote-list-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# How to pull changes from the Mate academy repository guideline

### Problem:
Sometimes mentors add changes to GitHub task when you already forked it and
downloaded to your local machine.

### Solution:
To get changes from Mate academy repository you have to add connection between this
repository and your local machine and pull changes. Follow the instructions below.
1. Open a terminal and type the command to see your remote connections:
```
git remote -v
```
you should see one connection to your forked repository:

<img src="../assets/remote-list-before.png" alt="Remote list before" width="500"/>

2. Go to origin Mate academy repository and copy a link to it:

<img src="../assets/link-to-mate-repo.png" alt="Link to Mate academy repository" width="1000"/>

3. Add another `remote` named 'upstream'. Pass link to Mate academy repository
you've recently copied:
```
git remote add upstream <copied_url>
```
4. Check that new remote was added:
```
git remote -v
```
you should see two connections now:

<img src="../assets/remote-list-after.png" alt="Remote list after" width="500"/>

5. Switch to `master` branch:
```
git checkout master
```
6. Pull changes from Mate academy repository:
```
git pull upstream master
```
7. Switch to your branch:
```
git checkout develop
```
Note: if you created another branch (not `develop`) use its name instead

8. Rebase commits from your branch:
```
git rebase master
```
9. Push changes to GitHub:
```
git push origin develop -f
```

Now you can continue working on the task.

0 comments on commit 4c4f665

Please sign in to comment.