forked from statds/ids-s23
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.qmd
55 lines (40 loc) · 2.08 KB
/
git.qmd
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
# Project Management with Git {#sec-git}
Many tutorials are available in different formats. Here is a [YouTube video
``Git and GitHub for Beginners --- Crash
Course''](https://www.youtube.com/watch?v=RGOj5yH7evk).
The video also covers GitHub, a cloud service for Git which provides a cloud
back up of your work and makes collaboration with co-workers easy. Similar
services are, for example, [bitbucket](bitbucket.org) and [GitLab](gitlab.com).
Here is a collection of [online Git exersices](https://gitexercises.fracz.com)
that I used for Git training in other courses that I taught.
## Set Up
To set up GitHub (other services like Bitbucket or GitLab are similar), you need to
+ Generate an SSH key if you don't have one already.
+ Sign up an GitHub account.
+ Add the SSH key to your GitHub account
## Most Frequently Used Git Commands
+ `git clone`
+ `git pull`
+ `git status`
+ `git add`
+ `git remove`
+ `git commit`
+ `git push`
## Tips on using Git:
+ Use the command line interface instead of the web interface (e.g., upload on GitHub)
+ Make frequent small commits instead of rare large commits.
+ Make commit messages informative and meaningful.
+ Name your files/folders by some reasonable convention.
- Lower cases are better than upper cases.
- No blanks in file/folder names.
+ Keep the repo clean by not tracking generated files.
+ Creat a `.gitignore` file for better output from `git status`.
+ Keep the linewidth of sources to under 80 for better `git diff` view.
## Pull Request
To contribute to an open source project (e.g., our classnotes), use pull
requests. [Pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
"let you tell others about changes you've pushed to a branch in a repository on
GitHub. Once a pull request is opened, you can discuss and review the potential
changes with collaborators and add follow-up commits before your changes are
merged into the base branch."
Watch this YouTube video: [GitHub pull requests in 100 seconds](https://youtu.be/8lGpZkjnkt4).