-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitHubSetupInstructions
More file actions
108 lines (83 loc) · 5.25 KB
/
GitHubSetupInstructions
File metadata and controls
108 lines (83 loc) · 5.25 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Creating a New Repo and Using GitHub Desktop
You will need
GitHub Desktop App: https://desktop.github.com/download/
A github account added to our organization: https://github.com/
A code IDE, ie. R studio or VS Code
Creating a New Repo Workflow
1. Create a new repo on the GitHub website
Navigate to the inter-fluve organization > Repositories. Click New Repository.
You want to create a repo that is just one-off. Perhaps we will want to use these methods in the future, but you don’t see that clearly now. Don’t worry, if you choose this option, we can always make it a template later if we are using it a lot. Also we still have forking as an option
Give the project a name - the same as the folder + a descriptor of the action you are trying to take (ie. fish count analysis).
Give a description of the proj + the year
Private
Add a README
Add a .gitignore template of the language you will be coding in
Choose None for license
You want to create a template repo (For example: You are going to create code for an HSI, that could be used in other projects)
Create a new repo
Give it a name in all CAPS - this is how we can easily see templates
Always give a succinct description
Always choose private
Add a README file
Add a .gitignore template for the language you are anticipating
Do not add a license - this means others cannot use our code without our permission
Once the repo is created, open Settings > General and click “template repo”
C. You want to create a copy of a template repo. (For example, you want to create a new annual hydro stats graph)
Click “Repository template.” Select the template you want to use. Give the repo the same name as the project folder in the server + the name of the template repo. Ensure the owner is inter-fluve. Give it a description. Keep it private. Create repository.
2. Clone the repo to your local machine
Take it from the cloud on github to your computer where you can actually contribute to it.
One copy of the repo should be on the server. One person is the designated server repo maintainer, who will ensure that version is most up to date when deliverable or review periods may occur (and especially at project close). The other copies if there are multiple collaborators can be stored on your local machine wherever you like them to be (but if you don’t have a preference, put it in Documents).
Add new repo > Clone repository
Clone a repository from GitHub.com
Press the refresh button if you don’t see the repo you just made - it could take a second to load
IMPORTANT: Local Path should be the path to the appropriate place depending on the number of contributors. One version of the project on the server! Let’s try adding a Code folder to the Design_Analysis folders for now. This step ensures that the code is also on the server for other folks to see.
Click Clone
You now have the repoyou can use.
You can open it either by navigating to the folder on the server or clicking “Open the repository in your external editor
3. Using GitHub Desktop to Track Changes
After making changes to the files in the IDE of your choice, you can make commits to the repo directly from GitHub desktop (or GitKracken or whatever other git interface you like - here is how to use Desktop)
Save the changes to the file in the IDE
This will show up in the Changes tab of GitHub Desktop
Add a descriptive commit message
Commit to main. Check that the branch is what you want it to be (usually main). Push via either the blue button (circled) or top nav bar (starred). The top nav bar will also show if you need to pull.
Best Practices
Organization
Have at least 3 folders ALWAYS! INPUTS, OUTPUTS, SOURCE (where scripts live)!
Include a README for anything that is a first-version of a template and a unique project
Include contributors of sections of code
Add a description
Code Syntax
Select by named objects, not by position
Ie. data %>% select(“Date”, “Value”) NOT data %>% select(1, 2)
Comment regularly and descriptively
Use as few lines of code as possible to achieve the outcome
Name objects descriptively
Ie. RiparianVegDensity NOT Data2
Using Git for Only 1 Contributor
Using Git for Multiple Contributors
Outstanding Areas for Discussion
Notes
*We need to make the repos private
How to Check if Code is Correct (Review Process)
Understanding who are we trying to get to use git?
Proposal
Create a local repo using GitHub desktop within the server ClientFiles specific folder
One for each clientfile
We need to make a naming convention for this
Allows for pushing to GH and keeping the organization the same
For ones that are templates, consider forking
Best Practices
Use names, not positions to select variables
Practices for collaboration
Within the same document?
Pull requests
Forks
Pull Requests
Have a protected main branch
Create a branch for each person’s edits
Example document:
https://github.com/JVanDerHout/Environmental_Data_Analytics_2022/blob/main/Resources/GitHub%20Setup.pdf
Review (When Needed)
Work with PM and senior reviewers to determine if they are comfortable with analysis and tools being developed in code
Work with PM and senior reviewers to establish level of review needed (ex: new analysis being developed vs adaptation of simple code)
Work with PM and senior reviewers to establish if peers can review code