Git For Windows
来源:互联网 发布:黑米抢购软件靠谱吗 编辑:程序博客网 时间:2024/06/04 23:11
12.8
1.如果要在Windows下使用Git,可以有两种方式,分别是Cygwin和msysGit。
安装msysGit,下载网址:https://git-for-windows.github.io/
2.设置用户名,邮箱并生成秘钥添加到GitHub网站中。
3.GitHub中新建一个库并在Qtcreator设置git
git push-u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/waldenlakes/Advanced_UCF_shadow_mark.git'
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/waldenlakes/Advanced_UCF_shadow_mark
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'origin'.
git remote rm origin 这个是删除了origin这个远端的仓库和你本地的映射
问题1:
分析:更新被拒绝了,因为远程包含有本地没有的工作。这个通常是另一个仓库push时引起的。在push之前,你可以通过pull先把远程的改变完善。
解决,通过git pull origin master
提示README.md出现冲突,
本地项目内容如下:
remote里的内容如下:
后来就git add README.md,并commit和push
解决问题。
如果想要删除当前工作目录下的文件,
git rm main.txt
git commit -m "del_main.txt"
git push origin master
结果:
删除当前目录下的main.txt,同时会删除remote下的文件。
问题2:
2.1现在remote下的工程,A和B都同时clone到本地,然后,做了修改,比如A对a文件做了修改,B也对a文件做了修改也添加了b文件,如果B先提交了,那么remote是B的状态,然后此时A做提交时,B的状态已与CLONE时的状态发生了变化,此时怎么办?
2.2如果自己先在本地完成了项目,现在想放到github上面,应该怎么做?
首先要先在remote上创建一个新的仓库,不要添加README.md文件。
第二步,在本地目录下右键打开git BASH,打开窗口,然后在窗口中输入git init,使之变成git。
第三步,连接remote上,执行git remote add origin git@github.com:yourName/yourRepo.git
第四步,git add ,git commit -m,git push origin master。添加所有的文件,然后push。
此时目录下如果有个二级目录怎么办?
git add ./test/readme.txt
2.3remote上的项目,想放到本地,直接git clone就OK了。
参考网址:
http://www.runoob.com/w3cnote/git-guide.html【Github 简明教程】
https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013745374151782eb658c5a5ca454eaa451661275886c6000【工作区和暂存区】
http://www.worldhello.net/gotgit/01-meet-git/060-install-on-windows-msysgit.html
https://www.alexleo.click/how-to-install-git-on-windows/
http://blog.csdn.net/hebbely/article/details/52495073【Qt Creator 中使用 Git / Github】
http://www.jianshu.com/p/8d26730386f3【github上传时出现error: src refspec master does not match any解决办法】
- Git for Windows
- git for windows
- git for windows
- Git flow for windows
- git bash for windows
- Git For Windows
- git for windows
- Git Bash for Windows
- Git for windows安装
- Git for windows 配置
- Git for windows 码云
- git for windows
- Git For Windows
- git for windows还是github for windows?
- git for windows 中文乱码
- GIT使用笔记FOR Windows
- git for windows 汉化包
- Git-for-windows连接github
- Linux下搭建JDK+Tomca环境
- 解析excel表获取数据,并从远程服务器下载和上传文件
- 【精品文章推荐及点评】六个人如何运维一万台服务器?
- python 面向对象(进阶篇)
- 微信官方小店小程序老徐解析
- Git For Windows
- 为什么我们需要软件定制化?
- 路由器ipv6方案
- Linux用户与用户组的各类操作
- android调用百度音视频转码 MCT的SDK,BDCloudMediaPlayer初始化卡死的问题
- JVM学习点
- 欢迎使用CSDN-markdown编辑器
- 1548-Cannot load from mysql.proc. The table is probably corrupted
- 《Python学习手册》学习笔记(33)之第33章异常编码细节(关键词:编程语言/Python/异常)