forked from HoldenJe/LearnGit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackingMySteps.Rmd
More file actions
62 lines (54 loc) · 2.68 KB
/
TrackingMySteps.Rmd
File metadata and controls
62 lines (54 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: "My Steps"
author: "Jeremy Holden"
date: "23/01/2021"
output: html_document
---
<!--Z Slagle added two spaces (new line) to properly format and for testing pushing etc. This is cool!-->
## Keeping track of my steps:
1. I made a repo in Github
2. Created a readme and made a commit
3. Create new project in RStudio
4. From a Git repository
5. Copied credentials.
6. Created a new branch called dev_jer for local work
7. Created this documented, made a commit.
8. Added a function, made a commit
## New contributors
1. A different user can now fork (top right of github)
2. While there, create a new branch (dev_yourname)
2. Return to RStudio
3. Create New Project from GitHub repository
4. add https://github.com/YOURNAME/LearnGit as the url that you want to use to start the project
5. Check the directory where you want to save it - then do it!
6. When the project opens all the files should be cloned to your local project file
7. Make sure you are on the dev_yourname branch
8. Do some stuff, make some commits
9. Then do a push to your github
10. Go to github and do a pull request
11. I'll get an email telling me that you want to add something
## Merging contributions
1. On Github - merge to main
2. Do a local pull request to update local main
3. Switch to dev_* branch and "update from main"
## Some thoughts
1. I think contributors should fork from a development branch
2. Then, "production" files can be pushed to main
3. This keeps the main branch as uncluttered as possible
4. Maybe...
## Adding an upstream repo for forks
When you fork a repo you'll only get a snapshot of the repo at the time you clone it. Additional changes, but the owner or contributors will not automatically update in your repo. To do this you need to add an `upstream` repo to `fetch` new changes that have been made since you last contributed. To add this repo as the upstream repo for your local `LearnGit` project in RStudio switch to the **terminal** tab and run the following commands:
```{}
git remote add upstream https://github.com/HoldenJe/LearnGit
```
To update your local directory; which is a good idea to do *BEFORE* you start making new changes so that you can avoid any nasty `merge` conflicts; you simply do a `fetch` & `merge` by running:
```{}
git fetch upstream
git merge upstream/main
```
## Some useful pages
From Github's documentation:
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
From FreeCodeCamp:
https://www.freecodecamp.org/news/git-pull-force-how-to-overwrite-local-changes-with-git/