Як створити репозиторій на GitHub

 


Як створити репозиторій на GitHub

Від Vertex Academy 
vertex-academy.com
хв
25 березня 2019 р

Як тільки Ви створили еккаунт на GitHub (див. статтю  "Як зареєструватися на GitHub" ), перед Вами має з'явитися схоже вікно:

На самому верху, як бачите, сторінка пропонує Вам прочитати гід по сайту. Ви можете зробити це у вільний час для кращого знайомства з функціоналом сторінки - Вам доведеться проводити на ній досить багато часу.

Але зараз, давайте почнемо з основ. Зверху зліва знаходиться пошуковий рядок:

Праворуч угорі - невелике меню:

Дзвіночок - це повідомлення.

Якщо натиснути на іконку праворуч, з'явиться мене для керування обліковим записом:

Якщо ж натиснути на плюс, відкриється меню:

Як бачите, можна:

  • створити новий репозиторій ("New repository")
  • імпортувати репозиторій ("Import repository")
  • новий gist ("New gist") - щось на кшталт статті в блог
  • нова організація ("New organisation") - наприклад, Ви можете створити організацію, з якою можна пов'язувати облікові записи GitHub.

Три способи створити репозиторій на GitHub:

Cпособ 1:  нажать на "New repository".

Спосіб 2 : натиснути на велику кнопку "Start a project" ("Створити проект"):

Спосіб 3: натиснути на зелену кнопку "New repository" ("Новий репозиторій") у вікні  Repositories ("Репозиторії"):

Створюємо репозиторій на GitHub

Ви вже знаєте три способи створення нового репозиторію! 🙂 Тоді створіть репозиторій , використовував будь-який з 3 способів.

Створили? Відмінно, тоді Ви повинні побачити таку сторінку:

Чудово! Давайте розберемо частинами.

Зверху, Ви бачите власника репозиторію ("Owner"), і назву репозиторію ("Repository name"). Давайте назвемо його "first-repo":

Як вибирати ім'я для репозиторію

У мові Java є певні Naming Conventions (Code Conventions) , тобто. угоду у тому, як слід називати змінні, класи, методи тощо. Як Ви напевно пам'ятаєте, Java прийнято використовувати CamelCase (інше CamelStyle).

На GitHub таких правил немає. Тим не менш, часто можна побачити запис через дефіс (як ми зробили), або тим же CamelCase.

Наприклад, можна подивитися на репозиторії:

  • Google (https://github.com/google)
  • Facebook (https://github.com/facebook)
  • Microsoft (https://github.com/Microsoft)

Так виглядає репозиторій Google.

Якщо Ви перегляньте ці репозиторії, то побачите, що найчастіше назви з кількох слів записуються через дефіс, або CamelCase.

Повертаємося до створення репозиторію

Отже, далі йде опис (Description). Писати його не обов'язково (праворуч від "Description" сірим написано слово "optional"). Але якщо Ви хочете, щоб роботодавець, який буде дивитися на Ваш обліковий запис, або інші програмісти, змогли зрозуміти про що йдеться та оцінили Вашу роботу, бажано докладно описувати проекти. Зокрема це можна зробити за допомогою README (про це пізніше).

В описі давайте напишемо "Перший проект на Git":

Потім ми можемо вибрати, чи буде наш проект публічним (тобто всі зможуть його бачити), чи приватним. Як Ви пам'ятаєте, на безкоштовних облікових записах  GitHub надає безмежне сховище тільки для публічних проектів .

Вибираємо "Public":

На цьому ми можемо зупинитися та натиснути велику зелену кнопку "Створити репозиторій" ("Create repository"). Проте є ще кілька налаштувань, які ми можемо зробити.

По-перше, Ви бачите галочку "Initialise this repository with a README" (Створити репозиторій із README). README - це ще один спосіб розповісти людям, які переглядають Ваш репозиторій про Ваш проект.

Добре розписані README буде виглядати приблизно так:

Але написання таких файлів – окрема наука. Файл README має розширення .md, свій синтаксис та мітки. Докладніше про те, як слід писати файл README, ми розглянемо в наступних статтях.

Крім створення README, ми маємо ще дві опції - чи додавати файл .gitignore (за замовчуванням None - не додавати), і чи додавати ліцензію (за замовчуванням теж None ).

Про те, що таке .gitignore файл, ми поговоримо в наступних статтях. У двох словах, це файл, який говорить GIT, які файли слід ігнорувати під час завантаження.

Також, Ви можете додати ліцензію до свого проекту:

Справа в тому, що на GitHub розміщують багато open-source проектів, тобто безкоштовних програм з відкритим кодом. Цікаво, що ліцензія зазвичай використовується не для того, щоб обмежити доступ до проекту, а навпаки, щоб дозволити іншим людям використовувати Ваш код. Коли Ви нічого не вказуєте у полі "ліцензія", використання коду з репозиторію вважається крадіжкою.

Отже, чудово! Ми розібралися із основними полями, які треба заповнити. Тепер натиснемо велику зелену кнопку "Створити репозиторій" ("Create repository").

Тепер Ви повинні бачити перед собою схожу сторінку:

Ось ми створили свій перший репозиторій на GitHub. Тепер він з'явиться у Вас у розділі "Репозиторії" на головній сторінці:

Тепер ми можемо завантажувати проекти з комп'ютера на віддалений репозиторій GitHub. Про те, як це робити, ми поговоримо у наступних статтях.

Дякую, що були з нами! 🙂


Сподіваємось, що наша стаття була Вам корисною. Можна записатися до нас на курси Java  на сайті .




How to create a repository on GitHub

By Vertex Academy 
vertex-academy.com
4 min
March 25, 2019

Once you have created an account on GitHub (see the article  "How to register on GitHub" ), you should see a similar window:

At the very top, as you can see, the page invites you to read the site guide. You can do this in your free time to get better acquainted with the functionality of the page - and you will have to spend quite a lot of time on it.

But for now, let's start with the basics. On the top left is the search bar:

Top right - a small menu:

The bell is for notifications.

If you click on the icon on the right, you will see me to manage your account:

If you click on the plus, a drop-down menu will open:

As you can see, you can:

  • create a new repository ("New repository")
  • import repository ("Import repository")
  • new gist ("New gist") - something like a blog post
  • new organization ("New organization") - for example, you can create an organization to which GitHub accounts can be associated.

Three ways to create a repository on GitHub:

Method 1:  click on "New repository".

Method 2 : click on the big "Start a project" button :

Method 3: Click on the green "New repository" button in the  Repositories window :

Create a repository on GitHub

You already know three ways to create a new repository! 🙂 Then create a repository using any of the 3 ways.

Created? Great, then you should see a page like this:

Great! Let's break it down piece by piece.

At the top, you see the owner of the repository ("Owner"), and the name of the repository ("Repository name"). Let's call it "first-repo":

How to choose a name for a repository

The Java language has certain Naming Conventions (Code Conventions) , i.e. agreement on how variables, classes, methods, etc. should be named. As you probably remember, in Java it is customary to use CamelCase (aka CamelStyle).

There are no such rules on GitHub. However, you can often see the entry with a hyphen (as we did), or the same CamelCase.

For example, you can look at the repositories:

  • Google (https://github.com/google)
  • Facebook (https://github.com/facebook)
  • Microsoft (https://github.com/Microsoft)

This is what the Google repository looks like.

If you look through these repositories, you will see that most often the names of several words are written with a hyphen, or CamelCase.

Back to creating a repository

So, next comes the description ("Description"). Writing it is optional (the word "optional" is written in gray to the right of "Description"). But if you want the employer who will look at your account, or other programmers, to be able to understand what is at stake and appreciate your work, it is advisable to describe projects in detail. In particular, this can be done using the README (more on that later).

In the description, let's write "First Git project":

We can then choose whether our project will be public (i.e. everyone will be able to see it) or private. As you remember, free  GitHub accounts only provide unlimited storage for public projects .

Select "Public":

We can stop there and click the big green "Create repository" button. However, there are still a few tweaks we can make.

First, you see the "Initialize this repository with a README" checkbox. README is another way to tell people viewing your repository about your project.

A well-written README would look something like this:

But writing such files is a separate science. The README file has an .md extension, syntax, and labels. We will look at how to write a README file in more detail in the following articles.

In addition to creating a README, we have two more options - whether to add a .gitignore file (default is None ), and whether to add a license (default is also None ).

We will talk about what a .gitignore file is in future articles. In a nutshell, this is the file that tells GIT which files to ignore when downloading.

Also, you can potentially add a license to your project:

The fact is that GitHub hosts many open-source projects, that is, free open source programs. Interestingly, the license is usually used not to restrict access to the project, but rather to allow other people to use your code. When you don't specify anything in the "license" field, using the code from the repository is considered theft.

So great! We figured out the main fields that need to be filled. Now, click on the big green "Create repository" button.

You should now see a similar page in front of you:

So we created our first repository on GitHub. Now it will appear in your "Repositories" section on the main page:

Now we can upload projects from our computer to a remote GitHub repository. We will talk about how to do this in future articles.

Thank you for being with us! 🙂


We hope that our article was useful to you. You can sign up for our Java courses  on the website .


Просмотры:

Коментарі

Популярні публікації