如何在github上创建一个Repository

发布网友 发布时间:2022-04-23 17:13

我来回答

1个回答

热心网友 时间:2023-10-05 15:23

1、进入github主页,点击创建repository
2、填写必备信息,点击create repository
3、创建成功的页面
4、打开Git bash,创建gifviewr工作路径,然后clone你的工程。工程路径在页面的右下角
命令如下:
创建目录
mkdir gifviewer
clone代码
git clone https://github.com/tanqiantot/gifviewer.git
成功后可以看到两个文件:
ls -a
.git REDME.md
5、尝试push一个修改到remote
1)首先修改README.md
2)git status
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: README.md
#
3)$ git add README.md
4)再次git status
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: README.md
#
5)git commit
$ git commit -m "test1"
[master 015b40b] test1
1 file changed, 2 insertions(+)
6)git push
$ git push https://github.com/tanqiantot/gifviewer.git master
Username for 'https://github.com': tanqiantot
Password for 'https://tanqiantot@github.com':
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 307 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/tanqiantot/gifviewer.git
ad8ff9c..015b40b master -> master
7)查看github网站,发现你的修改已经提交成功。

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com