windows下使用git和github建立远程仓库

windows下使用gitgithub建立远程仓库

(查看附件)

 

(01)Generating a new SSH key

Open Git Bash(rootpath:C:\Users\Administrator)

Paste the text below, substituting in your GitHub email address.

$ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

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

Generating public/private rsa key pair.

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 (/c/Users/you/.ssh/id_rsa):[Press enter]

 

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]

 

(02)Generating a new SSH key

Adding your SSH key to the ssh-agent

Before adding a new SSH key to the ssh-agent to manage your keys, you should have checked for existing SSH keys and generated a new SSH key.

If you have GitHub Desktop 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 the ssh-agent is running:

  •                                                        If you are using the Git Shell that's installed with GitHub Desktop, the ssh-agent should be running.
  •                                                        If you are using another terminal prompt, such as Git for Windows, you can use the "Auto-launching the ssh-agent" instructions in "Working with SSH key passphrases", or start it manually:

# start the ssh-agent in the background

$eval $(ssh-agent -s)

Agent pid 59566

.                                    

Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.

$ssh-add ~/.ssh/id_rsa

.                                    

(03)Add the SSH key to your GitHub account

 

1508594994(1)

(04)Create remote GitHub project

1508594365

 

(05)Create locak repertory(The name need same with remote repertory )

(05)Configure account

(05)Conneation local repertoy to remote repertory

 


Force connection: 
git push -f machine master

push to remote repertory for save name and password:
git config --global credential.helper "store"

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值