|
1 | | -# Git Tutorial using |
| 1 | +# Git Tutorial |
2 | 2 |
|
3 | | -> VS Code on Binder |
4 | | -> VS Code on Binder, because sometimes you need a real editor. |
| 3 | +Sign-Up to the workshop here (being logged in with your DTU Microsoft account): [Sign-Up Form](https://forms.office.com/e/62H1nV61R0) |
5 | 4 |
|
6 | | -[](https://pypi.org/project/jupyter-vscode-proxy/) |
7 | | -[](https://github.com/conda-forge/jupyter-vscode-proxy-feedstock) |
| 5 | +## Announcement |
8 | 6 |
|
9 | | -Start: |
10 | | - - lab: [](https://mybinder.org/v2/gh/RasmussenLab/git-tutorial/master?urlpath=lab) |
11 | | - - vscode: [](https://mybinder.org/v2/gh/RasmussenLab/git-tutorial/master?urlpath=vscode?folder=/home/jovyan/examples) |
| 7 | +This workshop will give you the opportunity to practice git as a version control system |
| 8 | +and Github as a website to host your repositories. Using git you can track changes in |
| 9 | +folders. It allows you track your progress and to spot random typos when working on |
| 10 | +many projects and tasks in parallel. In the workshop you will get the time to practice |
| 11 | +the fundamental concepts and actions directly in your browser - either using VSCode in |
| 12 | +GitHub Codespaces or in using the GitHub web interface. If you want, you can also try |
| 13 | +everything on your local computer. |
12 | 14 |
|
| 15 | +I will give a brief introduction to git. Then you will specific workflows by |
| 16 | +collaboratively work on extending a [recipe book](https://biosustain.github.io/recipe-book/) |
| 17 | +(please bring a recipe you like). |
| 18 | +You will learn how to work on |
| 19 | +[branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches), |
| 20 | +review [Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) |
| 21 | +and merge them into the main branch. If you have specific requests, feel free to reach out to me. |
13 | 22 |
|
14 | | -## Explore |
| 23 | +If you have specific requests, feel free to reach out to [me](mailto:heweb@dtu.dk) and/or write it down in the sign-up form. |
15 | 24 |
|
16 | | -You will need to setup your git email and user-name |
17 | | -(replace with yours in case you want to commit something, otherwise use copy-paste) |
| 25 | +What you'll learn: |
18 | 26 |
|
19 | | -```bash |
20 | | -git config --global user.email "you@example.com" |
21 | | -git config --global user.name "Your Name" |
22 | | -``` |
23 | | -> could be added to local config using `git config user...` |
| 27 | +- Basic tasks and actions to perform with git (in VSCode or in the browser) |
| 28 | +- How to branch and tag |
| 29 | +- Follow trunk-based development |
| 30 | +- See how to merge and comment a Pull Request based on a branch |
| 31 | +- Solve merge conflicts |
| 32 | +- Familiarize yourself with VSCode’s and GitHub’s interface and user experience |
| 33 | +- Get to know new recipes |
24 | 34 |
|
25 | | -### Steps |
| 35 | +Minimal prerequisite: A [GitHub account](https://github.com/signup). |
| 36 | +If you want to follow along locally, please install |
| 37 | +[GitHub Desktop](https://desktop.github.com/download/) and |
| 38 | +[VSCode](https://code.visualstudio.com/) on your machine. |
26 | 39 |
|
27 | | -- create a folder with an empty repository (default `examples`) |
28 | | -- `git init` in console to initialize repo |
29 | | -- setup user.name and user.email |
30 | | -- create files, stage them and see what files are created in `.git/objects` |
31 | | -- commit files and check `.git/objects` |
32 | | -- create branches and checkout `.git/refs` and `git/branches` folder |
33 | | -- look at `git/HEAD` (maybe `git/ORIG_HEAD` if it exists) |
| 40 | +### Brief timeline of the workshop: |
34 | 41 |
|
35 | | -> try to create your own fork, and try to lauch it on [mybinder](https://mybinder.org/) |
| 42 | +| Time | Activity | |
| 43 | +| ------------- | ------------------------------------------ | |
| 44 | +| 10:00 - 10:15 | Coffee and snacks 🥐 | |
| 45 | +| 10:15 - 10:45 | Introduction and example workflow | |
| 46 | +| 10:45 - 12:00 | Working collaboratively on the recipe book | |
| 47 | +| 12:00 - 12:30 | lunch break (not included) | |
| 48 | +| 12:30 - 13:30 | Your question and advanced content | |
36 | 49 |
|
37 | | -## Links |
| 50 | +## Slides |
38 | 51 |
|
| 52 | +<iframe |
| 53 | +src="https://docs.google.com/presentation/d/1RsKMiKquE4wqncrAv9LEtjivGE_dGiHoJ8nKCxgVKeY/embed" |
| 54 | +frameborder="0" |
| 55 | +width="100%" height="480" |
| 56 | +allowfullscreen="true" |
| 57 | +mozallowfullscreen="true" |
| 58 | +webkitallowfullscreen="true"> |
| 59 | +</iframe> |
| 60 | + |
| 61 | +## Local Setup |
| 62 | + |
| 63 | +See [local_setup](local_setup.md) for instructions to setup git on your local computer. |
| 64 | + |
| 65 | +## Links to learn more |
| 66 | + |
| 67 | +- [git-intro by coderefinery](https://coderefinery.github.io/git-intro/#) |
39 | 68 | - [git-moji](https://gitmoji.dev/) |
40 | | -- [curious git](https://matthew-brett.github.io/curious-git/) - detailed intro to the inner workings |
41 | | -- [git parable](http://practical-neuroimaging.github.io/git_parable.html) - why git came to exist |
42 | | -- Videos: |
43 | | - - [Python-Git-Client](https://www.youtube.com/watch?v=xvzo_nV9PjU) |
44 | | - - [Git-Interals](https://www.youtube.com/watch?v=MYP56QJpDr4) |
45 | | - - [Git PyData Global 2021 talk](https://www.youtube.com/watch?v=rBYC3dEOOyI) |
46 | | - |
47 | | -## Inspect git objects |
48 | | - |
49 | | -```bash |
50 | | -git log --format=raw |
51 | | -git cat-file -p <hash> # pretty print |
52 | | -git cat-file -t <hash> # type |
53 | | - |
54 | | -# the binary object can also be inspected using different tools, |
55 | | -# which might make it easier to navigate to certain blobs: |
56 | | -cat .git/objects/<2c>/<38c> | zlib-flate -uncompress |
57 | | -``` |
58 | | - |
59 | | -## Note |
60 | | - |
61 | | -> Should be Run the Python Tsunami notebooks on binder. |
62 | | -?urlpath=vscode/?folder |
63 | | -Go directly to Python Tsunami repository in |
64 | | - - VSCode [](https://mybinder.org/v2/gh/RasmussenLab/git-tutorial/master?urlpath=vscode/?folder=/home/jovyan/PythonTsunami) |
65 | | - - JupyterLab [](https://mybinder.org/v2/gh/RasmussenLab/git-tutorial/master?urlpath=lab/tree/PythonTsunami) |
66 | | - - Jupyter Notebook [](https://mybinder.org/v2/gh/RasmussenLab/git-tutorial/master?urlpath=tree/PythonTsunami) |
| 69 | +- [Git Internals - Plumbing and Porcelain](https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain) |
| 70 | +- [Glossary of terms for git](https://www.git-scm.com/docs/gitglossary) |
| 71 | +- [Glossary terms for GitHub](https://docs.github.com/en/get-started/learning-about-github/github-glossary) |
0 commit comments