Git实战二

这篇博客记录了使用Git进行本地仓库初始化、添加文件、提交、查看状态、设置远程仓库以及处理远程推送问题的步骤。在过程中遇到了权限问题,通过生成SSH密钥对解决了GitHub的访问权限限制。
摘要由CSDN通过智能技术生成


Administrator@MS-20170301NRCW MINGW64 /d
$ mkdir learngit


Administrator@MS-20170301NRCW MINGW64 /d
$ cd learngit


Administrator@MS-20170301NRCW MINGW64 /d/learngit
$ git init
Initialized empty Git repository in D:/learngit/.git/


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git add file1.txt test1.txt


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git status
On branch master


No commits yet


Changes to be committed:
  (use "git rm --cached <file>..." to unstage)


        new file:   file1.txt
        new file:   test1.txt




Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git commit -m "commit success"
[master (root-commit) 62e1272] commit success
 2 files changed, 4 insertions(+)
 create mode 100644 file1.txt
 create mode 100644 test1.txt


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git status
On branch master
nothing to commit, working tree clean


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git remote


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git remote add origin git@github.com:MyGitHubHpu/python7.git


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git remote
origin


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$  git push -u origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 301 bytes | 150.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To github.com:MyGitHubHpu/python7.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git clone git@github.com:MyGitHubHpu/gitskills.git
Cloning into 'gitskills'...
ERROR: Repository not found.
fatal: Could not read from remote repository.


Please make sure you have the correct access rights
and the repository exists.


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$ git clone git@github.com:MyGitHubHpu/gitskills.git
Cloning into 'gitskills'...
ERROR: Repository not found.
fatal: Could not read from remote repository.


Please make sure you have the correct access rights
and the repository exists.


Administrator@MS-20170301NRCW MINGW64 /d/learngit (master)
$  ssh-keygen -t rsa -C "13693916721@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
Enter passphrase (empt

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值