Windows connect to github

Installing GitHub Desktop

You can install GitHub Desktop on supported Windows or macOS operating systems.

In this article

About GitHub Desktop installation

You can install GitHub Desktop on supported operating systems. If you have an account on GitHub or GitHub Enterprise, you can connect your account to GitHub Desktop. For more information about creating an account, see «Signing up for a new GitHub account» or contact your GitHub Enterprise site administrator.

If you are a network administrator, you can deploy GitHub Desktop to computers running Windows on an Active Directory-managed network by using the Windows Installer package file ( .msi ) with Group Policy or another remote installation system.

The Windows Installer package extracts the standalone installer ( .exe ) and configures Windows to install GitHub Desktop the next time a user signs in to their workstation. Users must have permissions to install GitHub Desktop in their user directory.

If a user runs the Windows Installer package for GitHub Desktop directly, to complete the installation, the user must sign out of their workstation and then sign back in.

Downloading and installing GitHub Desktop

You can install GitHub Desktop on macOS 10.10 or later.

You can install GitHub Desktop on Windows 7 64-bit or later.

Warning: You must have a 64-bit operating system to run GitHub Desktop.

  1. Visit the download page for GitHub Desktop.
  2. Click Download for Windows.

Help us make these docs great!

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

Connect to github with ssh using windows

I am currently trying to use git on windows using ssh. I generated a key (with ssh-keygen -t rsa) and added the public key to github. Unfortunately, everytime I connect the following appears:

So, to get this working, I’ve done chmod 700 (like recommended in endless posts, for example SSH Private Key Permissions using Git GUI or ssh-keygen are too open ), and ls returns the following:

But unfortunately, ssh-add C:\Users\DaGeRe.ssh\id_rsa or ssh -T git@github.com stillreturns the error. The chmod command does not seem to work, even chmod -c 700 id_rsa (like said here: https://superuser.com/questions/397288/using-cygwin-in-windows-8-chmod-600-does-not-work-as-expected) does not change anything.

Trying to remove all rights with windows (by the menues in settings) also does not work. After adding the User «Everyone» (German: «Jeder», the user may be called different in english windows) in Properties -> Safety (also translated by me from «Eigenschaften -> Sicherheit») and rejecting any access for him, the warning disappears.

Читайте также:  Mac os usb setup

With the first, empty passphrase-key, the following output came out of ssh-add:

And after this, nothing is displayed. But ssh-add -l also returns nothing:

If I add an passphrase, it always says the passphrase is wrong, with the wrong rights (so the message from the beginning appears) and with the right rights (so no error appears, but it still says that the right phrase is wrong).

I am using OpenSSH 3.8.1 for windows and I don’t have cygwin installed.

So somehow it seems to not be added, even if the rights are set correct. I’d be glad if anyone had an hint how to solve this problem.

Git, GitHub и Visual Studio. В помощь новичкам

О чем:

В ней будет коротко рассмотрено что это за вещи, зачем нужны, и простой способ работы – из среды Visual Studio. То есть Bash или GitHub клиент использоваться не будут.

Внимание:

На Хабре уже есть похожая статья – [вот она]. В своей публикации я дополню слова Алексея и расскажу метод проще.

Для кого:

Статья направлена в помощь людям которые не работали с Git, GitHub, и хотят освоить в общих чертах как можно быстрее и без сложностей начать работу с ними.

О тексте:

Старался писать проще и с большим количеством скриншотов и пояснений. Ведь лучше, когда они есть чем, когда их нет и о чем-то приходится догадываться.

Итак, немного теории чтоб понять, что делать дальше:

  1. Git и GitHub – связаны, но они не одно и то же.
    Git – распределенная система контроля версий. Можете представить, как механизм резервного копирования, сохранения в играх. То есть в любой момент вы можете вернуться к предыдущему состоянию и попробовать сделать что-то иначе.
    Распределенная значит что все данные хранятся не только у вас, но и на сервере (GitHub), у других участников команды (если таковая имеется).
    Если непонятно, можете посмотреть — www.youtube.com/watch?v=w3jLJU7DT5E
  2. Терминология тоже имеется на ней внимание не заостряю, не о том сейчас.

Что нужно:

  • Visual Studio 2015 года или новее
  • Подключение к интернету
  • Несколько гигабайт памяти на жестком диске

Инструкция:

    Переходим в меню Tools → Extensions and Updates → откроется вкладка Installed → если в расширениях отсутствует «GitHub Extension for Visual Studio» идем дальше, иначе перейдите к пункту следующему пункту инструкции → вкладка Online → ищем в поиске наше расширение → скачиваем и устанавливаем.



На аккаунте GitHub создаем новый репозиторий. Смотрим:


После, с GitHub копируем ссылку:

  • Открываем Visual Studio → меню View → Team Explorer → в подпункте GitHub нажимаем Connect → вводим учетные данные → Sign in. Скриншоты:

  • Создаем какое-то решение или заходим в существующее и добавляем в систему контроля версий. Для этого нажимаем правой кнопкой мыши на решении (на проекте такого пункта нет) и выбираем “Add Solution to Source Control”:



    Нажимаем на стрелку внизу, и мы попадем в меню. В нем вставляем ссылку на репозиторий созданий ранее:



    Если репозиторий пустой все пройдет как надо. В моем случае там уже лежит один проект созданий специально чтоб вызвать ошибку. Он не имеет с этим ничего общего, даже файлы разные.
    Выходов из ситуации несколько, я рассмотрю только один из них — создание новой ветки [другой путь разработки, тестовый полигон. По умолчанию установлена ветка “master”] в репозитории для этого делаем следующее:

    Читайте также:  Windows bring all to front

      Может возникнуть вопрос – Что значат другие иконки?
      Ответ:
      Карандаш для того чтоб фиксировать изменения локально (commit). Используйте когда есть что сохранить, то есть код или файлы изменились.

    Все остальные тоже играют важную роль:

  • Применение их мы уже рассмотрели, но для лучшей наглядности еще раз(коротко):
    Создали решение с каким-то проектом→добавили в git→зафиксировали изменение (commit – иконка карандаша)→если есть проблемы поправляем по ситуации(код изменили[статья Алексея] либо новую ветвь создали[смотри пред. пункт], назад по истории сохранений (коммитов) вернулись[след. пункт], либо спросить на toster.ru или stackoverflow.com)→проект на GitHub;
  • Об списке коммитов (истории сохранений)

    Дополнительно:

    Чтоб GitHub верно отображал русские комментарии (если есть) при просмотре кода через сайт нужно сделать следующее:

    Cоветую всё-таки изучить Git Bash.

    Я старался писать как можно понятнее, если что-то не так, то поправьте в комментариях!
    На этом все. Спасибо за внимание!

    Данная статья не подлежит комментированию, поскольку её автор ещё не является полноправным участником сообщества. Вы сможете связаться с автором только после того, как он получит приглашение от кого-либо из участников сообщества. До этого момента его username будет скрыт псевдонимом.

    GitHub Extension for Visual Studio

    The easiest way to connect to your GitHub repositories in Visual Studio

    By downloading the extension you agree to the End-User License Agreement

    Requires Windows and Visual Studio 2015 or newer

    Easy Installation

    When you install Visual Studio, select the option to Customize the install and be sure to check the GitHub Extension for Visual Studio check box. It’s that easy.

    Did you already install Visual Studio without adding the extension? No worries, download it now.

    Connect to GitHub

    Once you install the extension, you can log into your GitHub.com or GitHub Enterprise account in Visual Studio with full support for two-factor authentication. There is no need to use personal API tokens.

    Clone repositories in one click

    Once connected, it’s quick to clone repositories from your account or any organization you belong to.

    Click the clone button to bring up a dialog that shows all the repositories you have access to. Use the filter textbox to quickly find the repository you’re interested in.

    Create repositories and build something great

    Need a new repository on GitHub? No problem! The create dialog makes it easy to create a repository on GitHub and clone it to Visual Studio all in one step.

    Publish your local work to GitHub

    Already have a project on your machine? Well what are you waiting for? Publish it to GitHub and start collaborating with others.

    In the Team Explorer window, click on the Sync tab to get to the Publish to GitHub dialog.

    View Pull Requests in Visual Studio

    View all of the Pull Requests for your project in the GitHub pane, and sort and filter them by Open/Closed state, Assignee and Author.

    Open the GitHub pane by typing GitHub into Visual Studio Quick Launch (Ctrl+Q).

    Читайте также:  Удаление папки всем содержимым linux

    Create Pull Requests from Visual Studio

    Turn a branch into a Pull Request directly from Visual Studio.

    In the GitHub pane, click the Create New link to create a new Pull Request on GitHub.

    Create Gists

    Create gists and upload them to GitHub directly from Visual Studio.

    Simply select the code to upload and select Create Gist from the GitHub context menu.

    Connecting to Github with SSH (Windows)

    Pre-requisites

    When to use SSH keys instead of HTTPS

    • Your corporate firewall blocks port 22, then even if you have set the remote origin to use HTTPS url, the authentication will fail as it is done via SSH.

    Remedy is to set up SSH keys and use SSH over HTTPS port 443.

    Below are some of the errors different applications throw when the port is blocked and HTTPS remote url is used.

    Git Bash

    When you try to push your changes, both Github Login and OpenSSH prompt asking for your username and password will fail with error remote no anonymous write access. fatal authentication failed for github .

    Github Desktop Application

    You will be able to login to your github desktop application as the authentication is done via HTTPS. However, when you try to push your changes it will result in authentication failure.

    Below is the logs captured by the desktop application showing that the git push is trying to authenticate via SSH.

    Generate new SSH key

    Generate SSH key with your email id as comment.

    When you’re prompted to “Enter a file in which to save the key,” press Enter to save the key in the default location (/c/Users/username/.ssh/id_rsa). Your public key will also get saved here.

    Copy the public key to clipboard.

    Add public SSH key to your GitHub account

    Go to Settings in your Github account to add the SSH public key.

    Under SSH keys tab, select New SSH key .

    Give a title and paste the key in the text area.

    Add private SSH key to the ssh-agent

    Git bash tool comes with a ssh-agent.

    /.bashrc file by running below command in git bash.

    Paste below script into your

    /.bashrc file to auto launch the ssh-agent whenever you run your git bash shell.

    This script will load the identities in the ssh agent from your default location

    Use SSH over HTTPS

    This step is required only if your corporate firewall is blocking port 22.

    Create a new config file in your .ssh directory i.e. /c/Users/username/.ssh/config

    Paste below contents in the file to use port 443 for SSH connections to host ssh.github.com .

    Run below command in git bash to verify that the configuration is working. Ignore any authentication failures.

    You can see that the SSH connection is now established via port 443.

    Verification

    To check if everything works as expected perform below steps:

    Run new git bash shell.

    Check if the identity has been added to the ssh agent.

    • Check that the key is being used by trying to connect to git@github.com.
    • Clone the repo using the SSH url.

    Going forward, every push/pull will use the SSH keys to authenticate with Github.

  • Оцените статью