首页 > 其他 > 详细

git简单操作

时间:2021-04-30 15:08:14      阅读:15      评论:0      收藏:0      [点我收藏+]

将已有的文件上传到github代码仓库

初始化

1.打开文件所在目录

2.git init:通过git init命令把这个目录变成Git可以管理的仓库:

上传文件步骤

3.git add 《文件:用.表示全部文件》

4.git commit: 用命令git commit告诉Git,把文件提交到仓库:

-m后面是本次提交说明

远程仓库

在github或者gieet创建新的git仓库

链接到github仓库

git remote add origin git@github.com:beingUSTC/logSystem.git

推送到github仓库

git push -u origin master

新建的仓库需要提交用户邮箱和用户名

git config --global user.email "you@example.com"

git config --global user.name "Your Name"

 

github使用ssh与客户端链接要生成ssh密钥

1.检查有无ssh若没有则生成ssh

~/.ssh` 或者用`~/.ssh ls
$ ssh-keygen -t rsa -C "youremail@example.com"
echo "# psaData" >> README.md

git init

git add README.md
//git add .

git config --global user.email "you@example.com" (可以去掉--global)

git config --global user.name "Your Name" (可以去掉--global)

git commit -m ""

git status

git remote add origin https://github.com/figosoar/psaData.git

git push -u origin master

 

git简单操作

原文:https://www.cnblogs.com/zengxy99/p/14721460.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!