Skip to content

SputnikTea/BOGY-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Introduction to Git

This repository is an introduction to git and GitHub. There are no prerequisites required.

If you want to learn more about version control, git and why to use it in software development, I recommend these tutorials from Atlassian:

In general, I found the Atlassian and GitHub tutorials very helpful when it comes to learn git and how to use it. Next to the official Documentation and Guide from git itself.

Setting up a GitHub account and cloning a repository

In this section, you will learn how to create your own GitHub Account and set it up to clone a repository to your PC. But before we start, you should read this introduction to git and GitHub (until GitHub and the command line), to get an understanding about why you should use it and what you can gain from it.

  1. Create a free GitHub account - Join GitHub
  2. Generate SSH keys and connect them with your GitHub account - How to add SSH keys to your GitHub Account
    Additional tutorials that maybe of help here:
  3. Clone this repository to your PC - How to clone a repository from GitHub

Bravo, now you can follow this guide on your own computer. Therefor, open the repository in an IDE of your choosing, like IntelliJ or VS Code.

Create your own repository and publish it on GitHub

in this section, you will learn the basic principles of git and how to use it on your local PC. We will do that with the help of an example repository

  1. Create your own repository - Init your own repository.
    You can skip the explanation about Bare repositories, later GitHub will do that for us. The name and purpose of the example repository (project) is up to you. For example, mine was about a cat feeding schedule.

  2. Add a README.md file to your repository - What is a README.md and how to write a good one
    This is a very lengthy explanation of README, for us only the beginning until Writing a good README... is relevant. Also, you don't have to include all sections the tutorial is talking about. For now, it is fine if you only include a Title and a short Introduction/Text.

  3. Save the README.md to the repository
    For that, use git commit and git add - Explanation of basic git commands & Example of contributing to a repository
    Here we tap in to the power and complexity of git. More detailed explanations about this process can be found here:

  4. Publish your repository on GitHub - Create a new repository on GitHub

    1. Create the public repository without any files
    2. Visit your GitHub repository after creation. GitHub will give you examples on how to populate it. Go with the push an existing repository example.
    3. Don't worry about the LICENSE and .gitignore file, we will add them later.

Well done, your README is now out there on the internet, if you have a peer, checkout his Repository ;)

One warning and two tips

The warning first: Never add, commit or push sensitive information in your repository!!!
Sensitive information can be Passwords, SSH keys, API keys, credit card numbers, PINs and more. Because of the nature of git, it is hard to delete something once it is pushed. If it happened any way, don't worry, there are plenty of guides to help you in this situation, for example this one - [Remove sensitive data from a repository].

Now the tips:

  1. If you ever found your self lost in git and don`t know what is going on, use git status. It will tell you what is going on and sometimes even provides tips what to do next. - What does 'git status' do?
  2. If the CLI (Command Line Interface) isn't your home, you can use a GUI (Graphical User Interface) to manage your repository. Modern IDEs (integrated development environment) mostly have a GUI for git included. Or you can use tools like Fork or GitKraken.

Next Steps

Now that we up to speed with git and GitHub, you can, checkout the BOGY-express repository and start writing a backend Server with JavaScript.

Optional:

If you still have time, you can follow the tutorials in this section to learn more about git.

What are branches and how to use them

  1. Create a branch - git branch
  2. Checkout another branch - git checkout
  3. Merge your branch back to main - git merge

How to use a remote repository

  1. See if there are any updates from other contributors - git fetch/pull
  2. Upload your changes to GitHub (the remote repository) - git push

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published