git使用步骤

git使用步骤,第1张

  1. 下载
  2. 安装
  3. 使用
  4. 创建GitHub账户




  5. cmd到你要上传的文件路径下面
  6. git init初始化,会生成.git文件


8. 设置用户名和密码和邮箱
,第一次登录要填写密码

Microsoft Windows [版本 10.0.22000.613]
(c) Microsoft Corporation。保留所有权利。

C:\Users\deqi5>cd c://

c:\>cd MyLearningFiles

c:\MyLearningFiles>cd repo1

c:\MyLearningFiles\repo1>git init
Initialized empty Git repository in C:/MyLearningFiles/repo1/.git/

c:\MyLearningFiles\repo1>git config --global user.name = "deqi-first"

c:\MyLearningFiles\repo1>git config --global user.email = "deqi525@outlook.com"

c:\MyLearningFiles\repo1>git add .

c:\MyLearningFiles\repo1>git commit -m "add test.txt"
[master (root-commit) e747611] add test.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.txt

c:\MyLearningFiles\repo1>git remote -v

c:\MyLearningFiles\repo1>git remote add origin https://github.com/deqi-first/Java.git

c:\MyLearningFiles\repo1>git remote -v
origin  https://github.com/deqi-first/Java.git (fetch)
origin  https://github.com/deqi-first/Java.git (push)

c:\MyLearningFiles\repo1>git push origin master
fatal: unable to access 'https://github.com/deqi-first/Java.git/': OpenSSL SSL_read: Connection was reset, errno 10054

c:\MyLearningFiles\repo1>git push origin master
Microsoft Windows [版本 10.0.22000.613]
(c) Microsoft Corporation。保留所有权利。

C:\Users\deqi5>cd C://

C:\>cd MyLearningFiles

C:\MyLearningFiles>cd repo1

C:\MyLearningFiles\repo1>git add .

C:\MyLearningFiles\repo1>git commit -m "add test.txt"
On branch master
nothing to commit, working tree clean

C:\MyLearningFiles\repo1>git remote -v
origin  https://github.com/deqi-first/Java.git (fetch)
origin  https://github.com/deqi-first/Java.git (push)

C:\MyLearningFiles\repo1>git push origin master
To https://github.com/deqi-first/Java.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/deqi-first/Java.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

C:\MyLearningFiles\repo1>git pull --rebase origin master
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), 390 bytes | 13.00 KiB/s, done.
From https://github.com/deqi-first/Java
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
Successfully rebased and updated refs/heads/master.

C:\MyLearningFiles\repo1>git push origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 249 bytes | 249.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/deqi-first/Java.git
   c7bdb93..7e1036d  master -> master

C:\MyLearningFiles\repo1>

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/732960.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存