-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitTut.html
More file actions
250 lines (243 loc) · 14.3 KB
/
gitTut.html
File metadata and controls
250 lines (243 loc) · 14.3 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!--DOCTYPE HTML-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Year of Programming: 2017</title>
<link rel="stylesheet" type="text/css" href="dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="dist/css/style.min.css">
<link rel="stylesheet" type="text/css" href="dist/css/style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro">
<link rel="shortcut icon" href="public/img/fav.ico" type="image/x-icon">
<script src="https://use.fontawesome.com/fe0e0c170d.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<nav class="navbar navbar-default" style="font-family: 'Source Code Pro', monospace;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Year of Programming: 2017</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/YearOfProgramming/2017Challenges" style="font-size: 15px">
<i class="fa fa-github fa-1x" aria-hidden="true"></i> GITHUB REPO
</a>
</li>
<li>
<a href="https://yearofprogramming.signup.team/" style="font-size: 15px">
<i class="fa fa-slack" aria-hidden="true"></i> SLACK CHANNEL
</a>
</li>
<li>
<a href="gitTut.html" style="font-size: 15px">
<i class="fa fa-list" aria-hidden="true"></i> USAGE TUTORIAL
</a>
</li>
</ul>
</div>
</div>
</nav>
<body>
<div id="body-container" class="container-fluid">
<div class="page-header">
<h1>Git Usage Tutorial</h1>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2>Submitting Your Work</h2>
<p>To participate, simply <a href="https://help.github.com/articles/fork-a-repo/">fork</a> the repository and then make a folder for your solution, inside the challenge you are solving.</p>
<p>If I am solving the zeroth challenge in Rust, I would work in the folder
<code>challenge_0/rust/myrrlyn</code>, to organize solutions by their language and then their author. This allows us to easily browse solutions by language, and compare work!</p>
<p>To submit, open a <a href="https://help.github.com/articles/about-pull-requests/">pull request</a> on the main repository. We'll make sure that merging won't cause any problems, and go from there.</p>
<p>When submitting a pull request please use the following format for your title:
<code>
[Language] Challenge #
</code></p>
<p><em>Note: Your solution will not be instantly accepted into the repository. We will be reviewing your code, file formatting and directory structure of your code. If you satisfy the requirements, then we will accept and merge.</em></p>
</div>
<div class="col-md-8 col-md-offset-2">
<h2>Gitting set Up (see what we did there?)</h2>
<p>If you do not have git <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">installed</a>, please do that first.</p>
<p><em>Note: If you have never used the command line a <code>$</code> before some text denotes a command and a line following that without the <code>$</code> denotes the output of that command.</em></p>
<h3>1. Verify your Git installation</h3>
<p>To confirm that you have git installed type in:
<code>
$ git --version
git version 1.9.1
</code> It should respond by showing you the version of git you have installed.</p>
<h3>2. <a href="https://help.github.com/articles/fork-a-repo/">Fork</a> The 2017Challenges Repository</h3>
<p>Click on the button on the top that says fork.</p>
<p><img src="https://github.com/YearOfProgramming/storage/blob/master/images/1.png?raw=true" alt="1" title="" /></p>
<p>You will now have a copy of the 2017Challenges repository in your profile.</p>
<h3>3. <a href="https://help.github.com/articles/cloning-a-repository/">Clone</a> your fork</h3>
<p>Click on the green dropdown button titled "Clone or download" and copy the URL there.</p>
<p><em>Note: I recommend cloning as <a href="https://help.github.com/articles/generating-an-ssh-key/">SSH</a> as it will allow you to use git without constant user authentication. If you are not comfortable with this yet, proceed with HTTPS.</em></p>
<p><img src="https://github.com/YearOfProgramming/storage/blob/master/images/2.png?raw=true" alt="2" title="" /></p>
<p>Open up your command line tool and enter:</p>
<p><em>Note: Enter the following without the following without the angled brackets (i.e. <code>git clone git@github.com:ManuelMeraz/2017Challenges.git</code>)</em></p>
<p><code>
$ cd ~
$ git clone <URL that you copied here>
Cloning into '2017Challenges'...
remote: Counting objects: 874, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 874 (delta 4), reused 0 (delta 0), pack-reused 860
Receiving objects: 100% (874/874), 95.41 KiB | 0 bytes/s, done.
Resolving deltas: 100% (324/324), done.
Checking connectivity... done.
</code></p>
<h3>4. Git configuration</h3>
<p>Next we will be <a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup">configuring</a> your git setup. </p>
<p><em>Note: Simply replace the text inside the quotation marks with your name and email.</em></p>
<p><code>
$ cd ~/2017Challenges/
$ git config --global push.default simple
$ git config --global user.name "John Doe"
$ git config --global user.email "your_email@example.com"
$ git remote add challenges https://github.com/YearOfProgramming/2017Challenges.git
</code></p>
<h3>5. Proceeding with a challenge</h3>
<p>The challenges will be structured in the following format ``` / -> root directory</p>
<p>README.md -> Contains the information in this help page challenge
<em>0/ -> challenge</em>
<number>
</p>
<pre><code> README.md -> File containing challenge prompt
r/ -> lowercase directory with your preferred language.
php/ -> If it does not exist, then create one.
python/
cpp/
csharp/
.../
/john -> your username in slack
/nick
/nancy
.../
README.md -> Documentation for your program. Be creative!
src/ -> contains your source code
</code></pre>
<p>```</p>
<p>Assuming that you are in the root of the directory you will look for the challenge you want to complete.</p>
<p><code>/challenge_#/</code></p>
<p>Move into the directory for the challenge you want to complete and see if a directory already exists for your preferred programming language.</p>
<p>If it exists, move into that directory. Otherwise, make a new directory for your language.</p>
<p><code>/challenge_#/language/</code></p>
<p><em>Note: The format for directory naming for programming languages is all lowercase plain text with no special characters(i.e. csharp).</em></p>
<p>Once inside your preferred programming language directory you will create a directory with your slackusername or name you want to be identified by for your work.</p>
<p><code>/challenge_#/language/name/</code></p>
<h6>Documentation for your program and source Code</h6>
<p>Inside this directory you will have 2 items: * A file named 'README.md' and inside you will document how your program works. * Your source code, preferably in a directory titled 'src'</p>
<p><em>Note: When you are documenting your program, pretend you are someone who has never seen that programming language and instruct them on the steps to run your program and how to use it. <a href="https://gist.github.com/anonymous/52b08845673ef9c86c12e94d95f412b5">Here</a> is a working template and <a href="https://gist.github.com/anonymous/d89ec2a00976b2d42f90990ee3796972">here</a> is an example.</em></p>
<p>Your set up should be as follows so far:
<code>
/challenge_#/language/name/README.md
/challenge_#/language/name/src/file_1
/challenge_#/language/name/src/file_2
/challenge_#/language/name/src/...
</code></p>
<h3>6. Submitting Your Code</h3>
<p>Assuming you are in the directory under your name you will enter the following
<code>
$ git add ./*
$ git commit -m "[Language] Challenge #"
$ git pull challenges master
$ git push origin master
</code></p>
<p><em>Note: Replace the text inside the quotations with the relevant information.</em></p>
<p>If you go to the page where your forked repository is contained your updated code should be there. </p>
<p>Click on the "New pull request" button to submit your work for review. Be sure to include the challenge number and language of your solution!</p>
<p><img src="https://raw.githubusercontent.com/YearOfProgramming/storage/master/images/3.png" alt="3" title="" /></p>
<h3>7. Acquiring New Challenges</h3>
<p>To get a new challenge that has just been posted you open your command line and enter
<code>
$ git pull challenges master
</code></p>
<p>This will download the newest solutions and challenges to your computer</p>
<h2>Workflow</h2>
<p>When a challenge is released we will notify everyone in the Slack chatroom. If you have the app installed on your phone, you will receive a notification. </p>
<p>To acquire the new challenge open up your command line tool move to the 2017Challenges directory and enter the following command</p>
<p><code>
$ cd ~/2017Challenges/
$ git pull challenges master
</code>
<em>Note: Your text editor might open up to commit a merge. You can simply close it and continue.</em></p>
<p>If you type in the command
<code>
$ ls
challenge_0 challenge_1 challenge_2 challenge_3 challenge_4 challenge_5 LICENSE.txt README.md Unittesting.md
</code> You should have something like the output here.</p>
<p>Move into the chalenge directory you want to complete and follow the same process as before for completing a challenge. Make sure to follow the <a href="#documentation-for-your-program-and-source-code">documentation</a> guidelines and <a href="#5-proceeding-with-a-challenge">formatting</a> guidelines. </p>
<p>After you have pushed your code to your forked repository as follows
<code>
$ git push origin master
</code></p>
<p>Then you can submit a pull request. </p>
<p><img src="https://raw.githubusercontent.com/YearOfProgramming/storage/master/images/github_flow.png" alt="workflow" title="" /></p>
<p><strong>All credit goes to <a href="https://github.com/SelectiveAlso">@selectivealso</a> from our slack chat for this awesome image!</strong></p>
<h2>Submission Review</h2>
<p>Reviewing and testing code is just as important as writing it. Peer to peer review is a core component of what we're striving to accomplish with our year of programming challenge. We would appreciate it if everyone who submits a solution reviews at least one other persons submission. All submitted code should be well documented and work for the provided test cases.</p>
<p>Pulling seperate pull requests to test code is cumbersome and we realize that. To help with this, we suggest using an online compiler so that you can check over anothers code without having to leave your browser. A good online compiler is <a href="https://repl.it/languages">repl.it</a> which has many languages available to work with!</p>
<h3>please follow these guildlines for pull request reviews</h3>
<ul>
<li>[ ] <strong>Code correctness</strong></li>
<li>Does the code compile and run?</li>
<li>If it compiles/runs, does it make sense? </li>
<li>[ ] <strong>Code Style</strong></li>
<li>Is the code readable?</li>
<li>Give positive feedback on what you liked!</li>
<li>What can they improve on?</li>
<li>[ ] <strong>Code Documentation</strong></li>
<li>Are there comments when needed or unnecessary comments?</li>
<li>Did they include a README.md with some basic <a href="https://gist.github.com/anonymous/52b08845673ef9c86c12e94d95f412b5">documentation</a>?</li>
<li>[ ] <strong>Path Structure</strong></li>
<li>Is the directory naming in all lower case for language and challenges?</li>
<li>The directory for the username and solution file don't follow any format</li>
<li>Encourage the use of a src/ directory for multiple files!</li>
<li>[ ] <strong>Merge Pull Request</strong></li>
<li>Is everything good? Check this off. </li>
</ul>
<p>You can copy and paste this:
<br>
<code>
- [ ] **Code Correctness**<br>
- [ ] **Code Style**<br>
- [ ] **Code Documentation**<br>
- [ ] **Path Structure**<br>
- [ ] **Merge Pull Request**
</code></p>
</div>
</div>
</div>
</div>
<div class="footer" style="color:#fff; background:#5C5C5C;">
<div class="col-md-8 col-md-offset-2" style="padding-top: 20px;">
<div class="row">
<div class="col-md-3 col-md-offset-2" style="text-align: center; font-size: 14px; padding-left:15px;">
<a href="https://github.com/YearOfProgramming/2017Challenges">
<i class="fa fa-github fa-5x" aria-hidden="true" style="padding-bottom: 10px"></i>
</a>
<p>GitHub</p>
</div>
<div class="col-md-3 col-md-offset-2" style="text-align: center; font-size: 14px; padding-right:30px;">
<a href="https://yearofprogramming.signup.team/">
<i class="fa fa-slack fa-5x" aria-hidden="true"style="padding-bottom: 10px " ></i>
</a>
<p>Slack Channel</p>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2" style="text-align: center">
<h6>Page created and maintained by YOP org Copyright © 2017</h6>
</div>
</div>
</div>
</div>
</body>
</html>