概述
一:
现在git上创建好项目,至于怎么创建在此不细说。单说如何把本地文件上传git。
二:
本地项目上传git,此处我使用命令行。
1.进入项目目录:我的项目在 [ E:/QtPro/navbutton ]
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton
2.输入: git init 初始化
$ git init
Initialized empty Git repository in E:/QtPro/navbutton/.git/
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
3.创建 REAdME文件,然后写入内容
$ touch README.md
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
4.把你在git上创建的项目路径加入,命令如下:
$ git remote add origin https://github.com/lsyefficient/navButton.git
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
5.添加README.md
$ git add README.md
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
6.第一次提交,命令如下:
$ git commit -m "first commit"
[master (root-commit) 089b0ea] first commit
1 file changed, 12 insertions(+)
create mode 100644 README.md
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
7.把提交的内容推到git上去
$ git push -u origin master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 511 bytes | 511.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/lsyefficient/navButton.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
8.增加该项目所有的内容
$ git add *
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
9.把刚增加的内容提交到待上传区域
$ git commit -m "second update"
[master 6f36d38] second update
15 files changed, 2797 insertions(+)
create mode 100644 README.md.bak
create mode 100644 formbutton.cpp
create mode 100644 formbutton.h
create mode 100644 formbutton.ui
create mode 100644 frmnavbutton.cpp
create mode 100644 frmnavbutton.h
create mode 100644 frmnavbutton.ui
create mode 100644 iconhelper.cpp
create mode 100644 iconhelper.h
create mode 100644 image/fontawesome-webfont.ttf
create mode 100644 main.cpp
create mode 100644 main.qrc
create mode 100644 navbutton.cpp
create mode 100644 navbutton.h
create mode 100644 navbutton.pro
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
10执行具体上传命令
$ git push -u origin master
Counting objects: 18, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (18/18), 96.52 KiB | 9.65 MiB/s, done.
Total 18 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
To https://github.com/lsyefficient/navButton.git
089b0ea..6f36d38 master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Bozone@Bozone61 MINGW64 /e/QtPro/navbutton (master)
最后
以上就是留胡子河马为你收集整理的qtcreator + git的使用的全部内容,希望文章能够帮你解决qtcreator + git的使用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复