yuyu520

导航

git简单操作

将已有的文件上传到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

 

posted on   zengxy520  阅读(183)  评论(0编辑  收藏  举报

努力加载评论中...
点击右上角即可分享
微信分享提示