How to Use GitHub without Writing a Single Line of Code
1 What is GitHub?
Many people think of GitHub as a tool mainly used by programmers for coding. In fact, the main feature of GitHub is version control and collaboration, which means that not only programmers but also non-technical people can use it to work more efficiently. Therefore, this article will teach you how to use GitHub from scratch, and help you get to know this powerful productivity tool. First, let's get familiar with some common GitHub terms:
- Repository: can be considered as a folder for storing code and files. When you are the repository owner, you can set access permissions.
- Remote Repository: a copy of the repository, usually used to make changes, which will be later added to the repository main branch.
- Main/Branch: the current status of the project.
- Branch: a copy of the main branch, used to temporarily store modified states, usually for updating the main branch.
- Push: submit modifications to the repository.
- Pull: synchronize updates from the repository to the current work state.
- Pull Request: used to merge modifications on the branch to the main branch.
- Merged: updates on the branch have been merged to the main branch, and the repository is updated.
Next, we will mainly use the GitHub Desktop client (which can be downloaded for free from the official website) to introduce the functions, which allows you to use most of GitHub's core functions.
2 What Can GitHub Do?
GitHub is an excellent tool for version control and collaboration.
2.1 Version Control
Specifically, version management can help save the modified history of files, so that it can be easily checked and rolled back when needed.
In the example, BulletTech's repository saves the change history, and you can click on the change to see the modified files and the corresponding updates.
2.2 Collaboration
These changes were made by members of the BulletTech team. When multiple people collaborate, it is recommended to work on different branches. After completing the updates, you can merge the updates on your branch to the main branch through a pull request (⌘/Ctrl + R). At this time, the software will automatically guide you to the web page to create a request. Members of the team can review the changes. If they meet the requirements, the update can be merged to the main branch.
It is recommended to set the merge request template. Filling in the update information clearly will save a lot of communication time and make it easier to trace back in the future. You can find the corresponding template in our repository and modify it according to your needs for use in your own project.
2.3 Build a Blog
GitHub provides free server hosting for simple blogs. BulletTech's own blog is built on GitHub. You just need to enable the GitHub Pages feature in the repository settings, and the blog will be generated automatically. GitHub provides many templates to choose from, or you can write your own from scratch. We won't go into detail here. If you are interested, please visit our repository to view the source code and learn.
3 How to Use GitHub
3.1 Create a Repository
After registering for GitHub, on your homepage, click the most prominent green button (New) to create a new repository. Clicking into the repository and clicking the green button (Code) will open GitHub Desktop and download the files to your computer. You can now start your project!
3.2 Basic Functions of GitHub Desktop
Basic operations are shown in the figure below. Please note that sometimes there may be conflicts when synchronizing (pulling) the repository. Most of the time it is because the local update has not been synchronized to the branch, but other people have updated the branch. In this case, you need to stash or discard your updates before synchronizing, which can be found in the top menu under Branch.
In summary, after mastering these basic knowledge and skills, you can use GitHub smoothly for file management, collaborative work, and create your own blog, and so far, without writing a single line of code. Of course, using code can also operate GitHub conveniently. Next time we will use command operations to explore GitHub. Stay tuned!