Как открыть репозиторий github для всех
Перейти к содержимому

Как открыть репозиторий github для всех

  • автор:

Add Collaborators in the Private Repository in GitHub: Step by Step guide

Positive Stud

As we know that we can create a public and private repository in GitHub as per our requirement, a question can arise — How can we work on a project with multiple team members at the same time? Hence, I will be answering this question in this blog.

If you want to acquire knowledge about public and private repository and learn to create these repositories then please go to the link provided below.

Managing access to your personal repositories

You can give people collaborator access to repositories owned by your personal account.

If you’re using GitHub Free, you can add unlimited collaborators on public and private repositories.

Inviting collaborators to a personal repository

You can invite users to become collaborators to your personal repository.

Removing a collaborator from a personal repository

When you remove a collaborator from your project, they lose read/write access to your repository. If the repository is private and the person has created a fork, then that fork is also deleted.

Removing yourself from a collaborator's repository

If you no longer want to be a collaborator on someone else’s repository, you can remove yourself.

Maintaining ownership continuity of your personal account's repositories

You can invite someone to manage your user owned repositories if you are not able to.

Help and support

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Sharing a repository with others

For the next step, get into pairs. One person will be the “Owner” and the other will be the “Collaborator”. The goal is that the Collaborator add changes into the Owner’s repository. We will switch roles at the end, so both persons will play Owner and Collaborator.

Practicing By Yourself

If you’re working through this lesson on your own, you can carry on by opening a second terminal window. This window will represent your partner, working on another computer. You won’t need to give anyone access on GitLab, because both ‘partners’ are you.

The Owner needs to give the Collaborator access. On GitLab, click the “Members” tab at the top, and enter your partner’s username.

Adding Collaborators on GitLab

Understanding GitLab permissions

GitLab permission levels might be complicated to understand. This table might come in handy.

Next, the Collaborator needs to download a copy of the Owner’s repository to her machine. This is called “cloning a repo”. To clone the Owner’s repo into her Desktop folder, the Collaborator enters:

Replace vlad with the Owner’s username.

The Collaborator can now make a change in her clone of the Owner’s repository, exactly the same way as we’ve been doing before:

Then push the change to the Owner’s repository on GitLab:

Note that we didn’t have to create a remote called origin : Git uses this name by default when we clone a repository. (This is why origin was a sensible choice earlier when we were setting up remotes by hand.)

Take a look to the Owner’s repository on its GitLab website now (maybe you need to refresh your browser.) You should be able to see the new commit made by the Collaborator.

To download the Collaborator’s changes from GitLab, the Owner now enters:

Now the three repositories (Owner’s local, Collaborator’s local, and Owner’s on GitLab) are back in sync.

A Basic Collaborative Workflow

In practice, it is good to be sure that you have an updated version of the repository you are collaborating on, so you should git pull before making our changes. The basic collaborative workflow would be:

update your local repo with git pull origin master ,

https://amdy.su/wp-admin/options-general.php?page=ad-inserter.php#tab-8

make your changes and stage them with git add ,

commit your changes with git commit -m , and

upload the changes to GitLab with git push origin master

It is better to make many commits with smaller changes rather than of one commit with massive changes: small commits are easier to read and review.

Switch Roles and Repeat

Switch roles and repeat the whole process.

The Owner push commits to the repository without giving any information to the Collaborator. How can the Collaborator find out what has changed with command line? And on GitLab?

On the command line, the Collaborator can use git fetch origin master to get the remote changes into the local repository, but without merging them. Then by running git diff master origin/master the Collaborator will see the changes output in the terminal.

On GitLab, the Collaborator can go to their own fork of the repository and look right above the light blue latest commit bar for a gray bar saying “This branch is 1 commit behind Our-Respository:master.” On the far right of that gray bar is a Compare icon and link. On the Compare page the Collaborator should change the base fork to their own repository, then click the link in the paragraph above to “compare across forks”, and finally change the head fork to the main repository. This will show all the commits that are different.

Comment Changes in GitLab

The Collaborator has some questions about one line change made by the Owner and has some suggestions to propose.

With GitLab, it is possible to comment the diff of a commit. Over the line of code to comment, a blue comment icon appears to open a comment window.

The Collaborator posts its comments and suggestions using GitLab interface.

Version History, Backup, and Version Control

Some backup software can keep a history of the versions of your files. They also allows you to recover specific versions. How is this functionality different from version control? What are some of the benifits of using version control, Git and GitLab?

git clone copies a remote repository to create a local repository with a remote called origin automatically set up.

<% right %>CC BY 4.0 — Based on git-novice © 2016–2017 Software Carpentry Foundation

Как я могу предоставить доступ к частному репозиторию GitHub?

У меня есть частный репозиторий git, и я хотел бы предоставить к нему доступ члену моей команды. Смогу ли я сделать это через сайт Github? У меня есть имя пользователя моего члена.

Я попытался сделать это, пройдя через страницу администратора репозитория, но такой возможности нет, так как я не владелец.

задан 04 июн ’12, 19:06

8 ответы

Если вы владелец, то все просто:

  • Перейдите в свой репозиторий и нажмите кнопку Settings кнопку.
  • В левом меню нажмите Collaborators
  • Затем добавьте их имя.

Затем соавтор должен посетить ссылку на этот пример репозитория. https://github.com/user/repo/invitations

это не сработало. он жалуется на открытый ключ, когда они пытаются клонировать репо. — Дэвиджнельсон

Я думаю, что это кнопка «Настройки» справа в вашем репозитории, так как я не вижу кнопку «Администратор» для моего случая. — Камрул

После капитального ремонта интерфейса в середине 2013 года он называется «Настройки». — Артур Клеменс

Это также дает им доступ для записи. Если вы хотите предоставить доступ только для чтения, вы должны использовать организацию. — Чарльз Милетт

Это не сработало для меня. Я добавил пользователя для частного репо (в качестве соавтора), но он не может извлечь из него .. — rj2700

Это простой трехэтапный процесс:
1) Перейдите в свое личное репо и нажмите настройки
2) Слева от экрана нажмите на Управлять доступом
3) Затем нажмите на Пригласить соавтора

ответ дан 01 мар ’20, в 12:03

соавтор получает 404, потому что в настоящее время это личное. — Дэниэл Хилл

Можем ли мы предоставить доступ администратора для частных репозиториев кому-то вместо роли соавтора? Я мог видеть только вариант соавтора. — НШива

Это простой 3 шаг Процесс :

  1. Перейдите в свое личное репо и нажмите settings
  2. Слева от экрана нажмите на Manage access
  3. Затем нажмите на Invite Collaborator

Приглашенный пользователь должен войти в Github, прежде чем щелкнуть ссылку приглашения в своем электронном письме, иначе он получит 404 ошибка.

Вот скриншот того, как это сделать:

Введите описание изображения здесь

Два шага:
1. Войдите в систему и нажмите «Пригласить кого-нибудь» в правом столбце в разделе «Люди». Введите и выберите идентификатор пользователя github.
2. Затем вам будет предложено «Пригласить имя пользователя в некоторые команды», после чего вы просто отметите, в какие команды вы хотите их добавить, а затем нажмите «Отправить приглашение».

В качестве альтернативы:
1. Получите идентификатор github человека (не его адрес электронной почты)
2. Перейдите к репозиторию, в который вы хотите добавить пользователя.
3. Нажмите «Настройки» в правом столбце (не настройки коробки передач вверху).
4. Нажмите «Соавторы» в левой колонке.
5. Выберите имя репозитория
6. Там, где написано «Пригласите или добавьте пользователей в команду», добавьте идентификатор github.
7. Приглашение будет отправлено по электронной почте.

Пожалуйста, дайте мне знать, как это сработало для вас!

ответ дан 20 авг.

Это простой трехэтапный процесс:

  1. Перейдите в свое личное репо и нажмите на настройки
  2. В левой части экрана нажмите «Управление доступом».
  3. Затем нажмите «Пригласить соавтора».

Это, а также то, что приглашенный пользователь должен войти в Github, прежде чем щелкнуть ссылку приглашения в своем электронном письме, иначе он получит ошибку 404.

Это возможно через GitHub Организации. Вы должны создать новую учетную запись.

Он работает в 2021 году,

Хотя репо нужно сначала сделать приватным, а затем щелкнуть
settings => Manage access => Invite Collaborator

Пользователь, получивший доступ к репозиторию, должен перейти к репозиторию и может вносить изменения в основную ветку.

Члены вашей команды должны получать доступ к репозиторию с помощью SSH, и для этого им необходимо сопоставить свой ключ ssh с учетной записью github. Это будет работать, если они сопоставят свой ключ ssh с учетной записью github, а также у репозитория есть публичные права, к которым они хотят получить доступ.

Создан 08 июля ’14, 03:07

Вы не должны писать это так, как будто это единственный способ сделать это, хотя это может быть достигнуто, в лучшем случае это громоздко, альтернативы проще и быстрее, предложите оба, если вы хотите предоставить полное решение — Cacoon

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками github or задайте свой вопрос.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *