`
MauerSu
  • 浏览: 519596 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

github免登陆提交commit

    博客分类:
  • git
 
阅读更多
源:https://help.github.com/articles/generating-ssh-keys/
评:如果是用git命令行 在第三步  1中   选择 eval $(ssh-agent -s) 命令

SSH / Generating SSH keys
Generating SSH keys

    mac
    windows
    linux
    all

SSH keys are a way to identify trusted computers, without involving passwords. The steps below will walk you through generating an SSH key and adding the public key to your GitHub account.

We recommend that you regularly review your SSH keys list and revoke any that haven't been used in a while.

Tip: If you have GitHub for Windows installed, you can use it to clone repositories and not deal with SSH keys. It also comes with the Git Bash tool, which is the preferred way of running git commands on Windows.
Step 1: Check for SSH keys

First, we need to check for existing SSH keys on your computer. Open Git Bash and enter:

ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist

Check the directory listing to see if you already have a public SSH key. By default, the filenames of the public keys are one of the following:

    id_dsa.pub
    id_ecdsa.pub
    id_ed25519.pub
    id_rsa.pub

Step 2: Generate a new SSH key

    With Git Bash still open, copy and paste the text below. Make sure you substitute in your GitHub email address.

    ssh-keygen -t rsa -C "your_email@example.com"
    # Creates a new ssh key, using the provided email as a label
    # Generating public/private rsa key pair.

    We strongly suggest keeping the default settings as they are, so when you're prompted to "Enter a file in which to save the key", just press Enter to continue.

    # Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]

    You'll be asked to enter a passphrase.

    # Enter passphrase (empty for no passphrase): [Type a passphrase]
    # Enter same passphrase again: [Type passphrase again]

    Tip: We strongly recommend a very good, secure passphrase. For more information, see "Working with SSH key passphrases".

    After you enter a passphrase, you'll be given the fingerprint, or id, of your SSH key. It will look something like this:

    # Your identification has been saved in /Users/you/.ssh/id_rsa.
    # Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
    # The key fingerprint is:
    # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com

Step 3: Add your key to the ssh-agent

To configure the ssh-agent program to use the SSH key you've generated:

If you have GitHub for Windows installed, you can use it to clone repositories and not deal with SSH keys. It also comes with the Git Bash tool, which is the preferred way of running git commands on Windows.

    Ensure ssh-agent is enabled:

        If you are using Git Bash, turn on ssh-agent:

        # start the ssh-agent in the background
        ssh-agent -s
        # Agent pid 59566

        If you are using another terminal prompt, such as msysgit, turn on ssh-agent:

        # start the ssh-agent in the background
        eval $(ssh-agent -s)
        # Agent pid 59566

    Add your generated SSH key to the ssh-agent:

    ssh-add ~/.ssh/id_rsa

Step 4: Add your SSH key to your account

To configure your GitHub account to use your SSH key:

Copy the SSH key to your clipboard. If your key is named id_dsa.pub, id_ecdsa.pub or id_ed25519.pub, then change the filename below from id_rsa.pub to the one that matches your key:

clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

Warning: It's important to copy the key exactly without adding newlines or whitespace.

Add the copied key to GitHub:

    Settings icon in the user barIn the top right corner of any page, click .

    SSH keysIn the user settings sidebar, click SSH keys.

    SSH Key buttonClick Add SSH key.
    In the Title field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
    The key fieldPaste your key into the "Key" field.
    The Add key buttonClick Add key.
    Confirm the action by entering your GitHub password.

Step 5: Test the connection

To make sure everything is working, you'll now try to SSH into . When you do this, you will be asked to authenticate this action using your password, which is the SSH key passphrase you created earlier.

    Open Git Bash and enter:

    ssh -T git@github.com
    # Attempts to ssh to GitHub

    You may see this warning:

    # The authenticity of host 'github.com (207.97.227.239)' can't be established.
    # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    # Are you sure you want to continue connecting (yes/no)?

    Verify the fingerprint in the message you see matches the following message, then type yes:

    # Hi username! You've successfully authenticated, but GitHub does not
    # provide shell access.

    If the username in the message is yours, you've successfully set up your SSH key!

    If you receive a message about "access denied," you can read these instructions for diagnosing the issue.

    If you're switching from HTTPS to SSH, you'll now need to update your remote repository URLs. For more information, see Changing a remote's URL.

分享到:
评论

相关推荐

    commit-comment:GitHub动作,用于为GitHub上的提交创建评论

    GitHub动作,可为GitHub上的提交创建评论。 用法 - name : Create commit comment uses : peter-evans/commit-comment@v1 with : body : | This is a multi-line test comment - With GitHub **Markdown** :...

    github-commit-history:Github提交历史记录是一个JS库,用于显示github存储库的提交历史记录。 它产生类似于Github的“提交”页面的列表。

    Github提交历史 该库可用于显示存储库上的最新X提交。 它使用jQuery从Github API获取数据。 默认样式类似于Github在提交日志中显示的样式。 演示版 用法 要在您的网站上使用此库,请下载它(请参阅下载)或克隆存...

    github-commit-watch:监控 github 提交的秘密

    github-commit-watch可帮助您的组织监控开发人员对这些错误的公开提交。 github-commit-watch通过电子邮件警报提供持续监控,易于配置,并且没有数据库要求。安装克隆 repo git clone git@github....

    github-commit-status:cli更新github上的提交状态

    github-commit-status 这是一个更新github上提交状态的简单实用程序。 主要用例是在构建环境中更新提交的状态。安装如果您使用的是OSX,请下载最新的二进制文件或brew tap thbishop/github-commit-status && brew ...

    github_commit_crawler, 用于连续监视Github组织错误 public 提交的工具.zip

    github_commit_crawler, 用于连续监视Github组织错误 public 提交的工具 GitHub提交爬虫这是什么?GitHub提交爬虫( ghcc ) 是一个枚举GitHub组织成员的工具,查找它的public 提交和解析可以能包含敏感信息( 。比如,...

    GitHub免费安装程序包

    - `git commit`:提交暂存区的改动。 - `git push`:将本地提交推送到远程仓库。 - `git pull`:从远程仓库拉取并合并最新的改动。 - `git merge`:合并分支。 5. **Git图形化工具**: - 对于不习惯命令行操作...

    github提交代码时报husky错误

    如果做H5项目,一般都有一些好用的模板,提交代码到github的时候,可能会报这个错误 husky &gt; pre-commit hook failed (add --no-verify to bypass) &gt; git config --get-all user.name &gt; git config --get-all user....

    make-empty-github-commit:使用API​​在GitHub上进行新的空提交

    使用API​​在GitHub上进行新的空提交 安装 需要版本6或更高版本。 npm install --save make-empty-github-commit 利用 命令行界面 从命令行 $(npm bin)/empty-commit --repo &lt;username&gt; --message "Empty commit ...

    如何给 GitHub commit 加个绿色图标(教程详解)

    在Git开发过程中,为了增强代码提交的可信度和识别性,有时我们会在GitHub上为提交(commit)添加一个绿色图标。这个绿色图标表示该提交经过了GPG(GNU Privacy Guard)签名,确保提交的来源真实可靠。本教程将详细...

    [Github Desktop][Git 教学] 图形接口05. 提交第一个commit与介绍Readme

    [Github_Desktop][Git_教學]_圖形介面#05._提交第一個commit與介紹Readme

    git-auto-commit-action:使用Github操作自动将更改的文件提交回Github

    该GitHub Action将自动提交在工作流运行期间已更改的文件,并将提交推回GitHub。 默认情况下,该提交以“ GitHub Actions”的名称进行,并由进行最后一次提交的用户共同创作。 这一举措受到了启发,并从适应加拿大...

    本地代码提交到GitHub步骤.docx

    git commit -m "首次提交,将本地项目集成到GitHub" ``` 最后,使用`git push`命令将本地的更改推送到GitHub远程仓库。第一次推送时,需要指定上游分支,使用`-u`选项连接到`origin`(默认的远程仓库名称)的`...

    whatthecommit-action:Github Action 修改上次提交

    用于提交来自消息的 GitHub 操作 这是一个 GitHub 操作,它更改最后一次提交并将其替换为来自 whatthecommit.com 的提交消息 提交给 黑客马拉松 有分叉的回购存在风险 :red_exclamation_mark: 设置 使用以下命令将...

    commit-crawler:GitHub 提交消息的爬虫

    提交爬虫GitHub 提交消息的爬虫这是一个爬虫程序,它收集 GitHub 流行存储库上的提交消息。如何使用获取 GitHub API 的访问令牌。 请参阅:为命令行使用创建访问令牌 Git 克隆和捆绑。 $ git clone ...

    GitHub Initial Commit-crx插件

    语言:English (United ...跳转到GitHub存储库的第一个提交 Github用户的Google Chrome(TM)扩展名。 厌倦了浏览一个Zillion页面,到Github.com上的首次提交存储库? 使用github初始提交,您可以单击单击到那里。

    Github One-Click Commit-crx插件

    语言:English 在github上单击commit mesages! 来自@hackernewsonion 的愚蠢的想法 为github的在线编辑器添加一键提交消息按钮! 列表可根据您的喜好定制。 灵感来自@hackernewsonion 的愚蠢的想法

    GitHub简介.docx

    提交(Commit)是指将更改保存到存储库的过程。每个提交都有一个关联的提交消息,该消息是说明为什么进行特定更改的说明。提交消息记录了更改的历史记录,因此其他人可以通过此来了解该库所做的事情和原因。 打开并...

    set-commit-status-action:GitHub动作来设置提交状态

    设置提交状态GitHub动作来更新给定提交的状态。输入项名称默认描述token github.token 用于设置提交状态的身份验证令牌。 默认为github.token 。 status pending 设置提交状态(“错误”,“失败”,“待处理”,...

    commit-task-dwarfdwarf:GitHub Classroom创建的commit-task-dwarfdwarf

    欢迎来到UWM IEEE-CS GitHub研讨会 这是任务1 。 如何完成 分叉此存储库 ... 提交更改git commit -m "Add motivation" 将您的更改推送到GitHub git push origin master 祝你好运!! 以下激励讯息 你能行的!

    手把手教你从eclipse 提交 代码到github

    2. 输入提交信息,例如"Initial commit"。 3. 选择要提交的文件,然后点击"提交"按钮。 4. 等待eclipse提交代码到github,这可能需要几秒钟。 5. 提交成功后,github将显示提交的信息。 结论:从eclipse提交代码到...

Global site tag (gtag.js) - Google Analytics