Github tutorial: You need to know these basics
In this tutorial we will introduce you to Github. Github is a platform where you can manage, store, and follow Git projects and users.
Github tutorial: what is git?
Before you can understand what Github is, you first need to understand the concept of Git:
- Git is a version management software for projects. You can use it to simply jump back to old stalls or work on a project with several people.
- You can either use Git in the command line of your operating system or in Github Desktop, a Git client with a graphical user interface. You need to know the following commands when using Git:
- git clone [URL]: Clone a Git repository from the URL to your local computer.
- git init: Initialize a Git project locally. You can optionally load this later on Github or another host.
- git add: Add files to the watch list. This step is mandatory in order to then upload your work to the repository.
- git commit: commit the changes. This is a booth that you can go back to at any time. Commit files before they can be sent to a remote repository.
- git push: With a push you send all commits to the remote repository on the servers of Github or the selected other provider.
Tutorial: what is github?
Github is the host for your Git projects and has similar properties to a social network.
- With Git you can access your projects saved in Github from anywhere.
- Repositories stored in Github are always public. So other users can view your projects. Private repositories are only available for a monthly fee.
- You can also contribute to existing programs by fixing bugs and actively participating in open source tools.
- Github is mostly used for extensive projects in certain programming languages. However, it is also possible to manage simple documents in Github.
Tutorial: Setting up Git and Github
Before you can start with Git and Github, you need a Github account and have to install Git locally. That's how it's done:
- First create an account on Github. This is fairly straightforward and can be done quickly and easily.
- To use Github productively, you now need Git on your local computer.
- Now install Git. Choose the installer you need for your operating system.
- Start the Git Bash you just installed on Windows. Start the normal terminal on macOS and Linux.
- With 'git config --global user.name "[Name]"' you now have to define your name.
- As before, use 'git config --global user.email "[Mail]"' to set your email address. Use the same mail here that you specified in Github.
Github Tutorial: Set up repository
If you want to start with a project, you can create a repository in two ways:
- In Github, click on the little book next to your username to create a new repository.
- Give your project a name here. As described above, you need to make the project public or pay a monthly fee.
- Then click on the green "Create repository" button. You can then add the repository locally using git clone as described above.
- Create a repository locally with git init. You can then link a local and an online repo with 'git remote add origin //github.com/[Username[/[Projektname[.git').
- You now have an online repository on Github so you can manage your projects and use them from anywhere.
You can read about how to use markup for your readme in Github in the next practical tip.