GitExerciseSolutions.txt 1.14 KB
Newer Older
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
Example solutions for Git Exercise

1. Assume remote repository created externally
Link to repo: https://github.com/coramthomas/bads-repo
2. Clone the project to your local disk
>>> git clone https://github.com/coramthomas/bads-repo bads-repo
>>> cd bads-repo/
3. Add a readme file with you name in it; do the first local commit; push this first commit to your public reo
>>> vi README.md 
>>> git add README.md 
>>> git commit -m "Created readme file"
>>> git push https://github.com/coramthomas/bads-repo
4. Create a notebook externally
5. Commit it to the local repo
>>> git add SinPlot.ipynb 
>>> git commit -m "Created SinPlot notebook"
6. Make some changes to the file
>>> git add SinPlot.ipynb 
>>> git commit -m "Added another plot"
7. Undo the changes
>>> git log --oneline
>>> git reset 9ea64d9
>>> git log --oneline
8. Create a new branch
>>> git branch patch
>>> git checkout patch
9. Make some changes to the file in the new branch
10. Commit the changes to the local repo
>>> git add SinPlot.ipynb 
>>> git commit -m "Added some more plots"
11. Push both branches to your remote public repository
>>> git push https://github.com/coramthomas/bads-repo --all