本文地址:http://www.jianshu.com/p/6030066a20e4
github地址:https://github.com/xy83918/CreateNewRepository
网页地址:https://xy83918.github.io/CreateNewRepository/
打开www.github.com注册你自己的账号,登陆后点击右上角的 (+)按钮,然后点击new Repository,如下图所示
创建一个新的Repository
填写Repository的名字.png
复制git地址.png
mkdir -p ~/Documents/2018code
cd ~/Documents/2018code
image.png
git clone https://github.com/xy83918/CreateNewRepository.git
image.png
ls
cd CreateNewRepository/
image.png
image.png
小技巧可以使用 open . 使用finder打开当前目录,然后把你想要添加的文件拖动到这个目录就可以了
open .
image.png
git status
image.png
echo “# test” >> test.txt
image.png
git status
image.png
git add -A
git commit -m "add test.txt"
git push origin master
image.png
image.png
image.png
贴出来方便大家粘贴
AlbertMP:CreateNewRepository Albert$ echo "这是一个网页" >> index.html
AlbertMP:CreateNewRepository Albert$ ls
README.md index.html test.txt
AlbertMP:CreateNewRepository Albert$ git add -A
AlbertMP:CreateNewRepository Albert$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: index.html
AlbertMP:CreateNewRepository Albert$ git commit -m "init"
[master 779e7e9] init
1 file changed, 1 insertion(+)
create mode 100644 index.html
AlbertMP:CreateNewRepository Albert$ git push origin master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 318 bytes | 318.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/xy83918/CreateNewRepository.git
163303f..779e7e9 master -> master
AlbertMP:CreateNewRepository Albert$
image.png
image.png
image.png
image.png
然后你就可以为所欲为了,想做什么静态网页都可以去修改这个html了。