新机git简单配置

新机git简单配置,毕竟不常用,不用每次都查
1、安装git
windows:https://git-scm.com/download/win
ubuntu: apt install git

2、全局配置

git config --global user.name "you_name"
git config --global user.email "[email protected]"

3、生成ssh-key
ssh-keygen -t rsa -b 4096 -C "[email protected]"

4、添加ssh到github 以后不用每次都输入邮箱及密码
cat ~/.ssh/id_rsa.pub
把输出的内容拷贝到github上
github 在https://github.com/settings/keys
点击左上角 New SSH key 把刚才的内容复制到下面的框里,点击Add SSH key

5、可以clone你自己的代码 然后修改提交了

参考:

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

  1. Open Terminal.
  2. Paste the text below, substituting in your GitHub email address.
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    

    This creates a new ssh key, using the provided email as a label.

    Generating public/private rsa key pair.
    
  3. When you‘re prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
    Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]
    
  4. At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]
    

https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

Note: DSA keys were deprecated in OpenSSH 7.0. If your operating system uses OpenSSH, you‘ll need to use an alternate type of key when setting up SSH, such as an RSA key. For instance, if your operating system is MacOS Sierra, you can set up SSH using an RSA key.

  1. Copy the SSH key to your clipboard.

    If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don‘t add any newlines or whitespace.

    $ sudo apt-get install xclip
    # Downloads and installs xclip. If you don‘t have `apt-get`, you might need to use another installer (like `yum`)
    
    $ xclip -sel clip < ~/.ssh/id_rsa.pub
    # Copies the contents of the id_rsa.pub file to your clipboard
    

    Tip: If xclip isn‘t working, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.

  2. In the upper-right corner of any page, click your profile photo, then click Settings.
  3. In the user settings sidebar, click SSH and GPG keys.
  4. Click New SSH key or Add SSH key.
  5. 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".
  6. Paste your key into the "Key" field.
  7. Click Add SSH key.
  8. If prompted, confirm your GitHub password.
时间: 2024-07-30 05:59:19

新机git简单配置的相关文章

猫猫学iOS 之第一次打开Xcode_git配置,git简单学习

猫猫分享,必须精品 原创文章,欢迎转载.转载请注明:翟乃玉的博客 地址:http://blog.csdn.net/u013357243 一:错误 当第一次打开Xcode我们进行commit操作的时候会报错: The working copy "測试" failed to commit files. * Please tell me who you are. Run git config –global user.email "[email protected]" g

hbuilder环境下简单配置git

以下简单罗列了hbuilder环境下简单配置git的相关资料: 1. hbuilder egit插件的安装使用 http://blog.csdn.net/u011871921/article/details/44238971 2.git 在本地创建了一个仓库并添加了文件,现在这个本地仓库不想要,怎么删除?而且不会删除仓库里面的文件? 可以先清除本地文件夹下的git文件,然后在重新初始化新建的git仓库 //删除文件夹下的所有 .git 文件 find . -name ".git" |

Git起步--git安装与初次运行git前配置

在你开始使用 Git 前,需要将它安装在你的计算机上. 即便已经安装,最好将它升级到最新的版本. 你可以通过软件包或者其它安装程序来安装,或者下载源码编译安装. 一.Git安装 1. 在linux上安装 我们可以使用发行版包含的基础软件包管理工具来安装,如果基于Fedora,我们可以使用  $ sudo yum install git 如果基于Debian,我们可以尝试apt-get  $ sudo apt-get install git Git 官方网站上有在各种 Unix 风格的系统上安装步

Git简单教程

该笔记总结廖雪峰Git教程, 参考网站: https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 一. 简介 Git采用分布式版本控制系统, 在此解释分布式与集中式的区别. 集中式版本控制系统: 版本库集中存放在中央服务器中, 工作时需要先请求最新版本, 工作结束后需向中央服务器提交最终版本. 分布式版本控制系统: 所有机器都有一份完整的版本库, 所以其中一个机器损坏不会导致整个项目丢

eclipse简单配置 eclipse中使用github Eclipse 快捷键

将eclipse压缩包解压到英文目录下 eclipse简单配置 设置字符集 Window--Preferences--General--Workspace--Text file Encoidng--Other--UTF-8 设置JDK路径 Window--Preferences--Java--Installed JREs 检查路径对应的是否为jdk,而不是jre.如果不是,要进行配置. 设置代码格式 Window--Preferences--Code Style--Formatter--edit

git简单使用入门总结

之前老早就听说过git,但是一直就没怎么去了解,之前在公司里头都是用的svn版本控制工具,然后上个月换到了新公司之后,团队里使用的是git工具,然后就专门花了点时间去了解了一番,当然期间也确实碰到了不少问题,从入职到到今天应该有快一个半月了,然后下面就是我将这一个半月以来针对git的理解使用后整理出来的一个简单入门总结. 一.安装git 我的电脑是win7系统,然后从git官网下载msysgit安装包(http://msysgit.github.io/),安装流程和一般的windows软件的安装

树莓派玩耍笔记1 -- 开箱 &amp; 安装系统以及简单配置

零.前言 树莓派是什么? 吃的么? 呵呵,如果您连这个还不知道,真是out 了.麻烦出门左拐,百度去(或者,看看官网去?),算了,还是粘贴一些大家都知道的树莓派百科吧: 树莓派由注册于英国的慈善组织"Raspberry Pi 基金会"开发,Eben·Upton/埃·厄普顿为项目带头人.2012年3月,英国剑桥大学埃本·阿普顿(Eben Epton)正式发售世界上最小的台式机,又称卡片式电脑,外形只有信用卡大小,却具有电脑的所有基本功能,这就是Raspberry Pi电脑板,中文译名&q

0123简单配置LNMP

简单配置LNMP不怕出现错误,就怕错误不知道出现在哪里?看日值tail -f /var/log/message -- 系统整个的日志tail -f /var/log/nginx/error.log -- 单个应用的日志http://www.cnblogs.com/make217/p/5836864.htmlhttp://www.cnblogs.com/xiaoit/p/3991037.html

Samba服务器的简单配置

案例说明: 公共目录        public   /abc            ro  允许任何人匿名访问, Daiqing1        smbdq1   /tmp/daiqing1   rw  不允许他人访问 Daiqing2        smbdq2   /tmp/daiqing2   rw  不允许他人访问 Samba服务器的简单配置,布布扣,bubuko.com