【tips】
终端默认的计算机名太长,看着也难受,于是我给改掉了
sudo scutil --set HostName a
a 是你要改的名字


Mac电脑自带Xcode软件
之后在“终端”输入代码~
xcode-select --install
下载 Command Line Tools软件时一切正常。
Xcode的Command Line Tools安装成功后,Git也意味着安装成功
检查Git命令是否成功
git --version
进行到这步的时候

我并没有注意到代码上面弹出的指令,包括之后我都没有关注到...
1.克隆项目到电脑
mkdir my_project
创建文件夹不容易出现问题。
cd my_project
进入文件夹也不会出现问题
git clone 项目地址
输入项目地址时我一直不知道具体地址,知道多次尝试之后,才发现原来可以直接复制

然后在 my_project 文件夹下建立一个 biancheng 文件夹

2.添加文件
首先打开
cd biancheng
open .
这步要注意,biancheng 文件夹在my_project 里,所以,要在终端上确认处于 my_project 文件里

之后就可以添加任何内容了
git status
在这步查看状态时

会出现一个 .DS_Store 这是电脑自带的一个隐藏文件(感觉像那种永远也删不掉的插件)不用管它,可以直接上传。
git add -A
这步是把 **全部 **文件作添加
git commit -m "任意命名"
这步就重要了,因为这步我折腾了好几遍。。。
《 "" 这两个双引号是英文的双引号,千万不要切换到中文输入。不然永远也打不出来》
m 后面记得打空格,因为这个问题我也重复了好几遍
输入完 git add -A 之后会出现一个小框,不要以为没发生变化,这是我在重复多次后才注意到的。


成功之后就是这样

最后一步上传
git push origin master

这代表上传中(拼网速的时候)这个时候如果网速不好是需要等一会儿的,因为之前不知道要等一会,我犯过直接重新开始的错误.....

这代表OK啦!


END
网友评论