创建本地库

Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan
$ git init
Initialized empty Git repository in C:/Training/huashan/.git/

Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan (master)
$ vim huashanjianfa.txt

Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan (master)
$ git add huashanjianfa.txt
warning: LF will be replaced by CRLF in huashanjianfa.txt.
The file will have its original line endings in your working directory

Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan (master)
$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   huashanjianfa.txt


Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan (master)
$ git commit huashanjianfa.txt
warning: LF will be replaced by CRLF in huashanjianfa.txt.
The file will have its original line endings in your working directory

*** Please tell me who you are.

Run

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

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Amber@DESKTOP-3S8028G.(none)')

Amber@DESKTOP-3S8028G MINGW64 /c/Training/huashan (master)

2. 登录github网站,注册github账号并登录

创建远端仓库

创建成功后,就会提示如下帮助信息

下面为当前远程库地址

需要设置全局用户名才可以commit

上传到远端

会弹出一个窗口输入用户名/密码

查看远端,发现文件已经被上传到远端库。

 

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐