Answer

问题及解答

首次提交 calculator 至 github

Posted by haifeng on 2019-02-18 10:11:07 last update 2019-05-02 20:07:29 | Edit | Answers (0)

首先登录 github.com, 创建一个空项目 calculator, 属性 private.

复制地址, 比如 https://github.com/haifeng2017/calculator.git

 

然后启动 git

git clone https://github.com/haifeng2017/calculator.git

haife@hp MINGW64 /d/download/github/calculator (master)
$ ls -la
total 9
drwxr-xr-x 1 haife 197609  0 2月  18 10:04 ./
drwxr-xr-x 1 haife 197609  0 2月  18 10:03 ../
drwxr-xr-x 1 haife 197609  0 2月  18 10:04 .git/
-rw-r--r-- 1 haife 197609 37 2月  18 10:04 README.md

haife@hp MINGW64 /d/download/github/calculator (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working tree clean

 

haife@hp MINGW64 /d/download/github/calculator (master)
$ git log
commit 5de81a63ce8e6825f088c5d833468e9f2d324dde (HEAD -> master, origin/master, origin/HEAD)
Author: Haifeng <31621528+haifeng2017@users.noreply.github.com>
Date:   Mon Feb 18 09:27:33 2019 +0800

    Initial commit

haife@hp MINGW64 /d/download/github/calculator (master)
$ ls
README.md

 

将要上传的文件拷贝到此文件夹.(对于 VS2015 C++ 项目, 下面的 .vs 文件夹和 .suo 文件不必上传)

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add .vs

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add calculator

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add Release

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add calculator.sln

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add calculator.suo

haife@hp MINGW64 /d/download/github/calculator (master)
$ git add readme.txt

haife@hp MINGW64 /d/download/github/calculator (master)
$ git commit -m "First commit, version 0.444"
[master b5b10ce] First commit, version 0.444
 17 files changed, 7831 insertions(+)
 create mode 100644 .vs/calculator/v14/.suo
 create mode 100644 Release/calculator.exe
 create mode 100644 calculator.sln
 create mode 100644 calculator.suo
 create mode 100644 calculator/BigNumber.cpp
 create mode 100644 calculator/BigNumber.h
 create mode 100644 calculator/ReadMe.txt
 create mode 100644 calculator/Variable.h
 create mode 100644 calculator/calculator.cpp
 create mode 100644 calculator/calculator.vcxproj
 create mode 100644 calculator/calculator.vcxproj.filters
 create mode 100644 calculator/calculator.vcxproj.user
 create mode 100644 calculator/sqrt.cpp
 create mode 100644 calculator/stdafx.cpp
 create mode 100644 calculator/stdafx.h
 create mode 100644 calculator/targetver.h
 create mode 100644 readme.txt

 

haife@hp MINGW64 /d/download/github/calculator (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

 

haife@hp MINGW64 /d/download/github/calculator (master)
$ git push
fatal: HttpRequestException encountered.
   发送请求时出错。
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (24/24), 121.07 KiB | 2.58 MiB/s, done.
Total 24 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
To https://github.com/haifeng2017/calculator.git
   5de81a6..b5b10ce  master -> master