git 笔记

git安装:git、gitLab、TortoiseGit

Git使用——Windows平台上配置使用

git提交项目步骤:

第一步:新建Test文件夹,里面添加几个文件。右击Test文件夹根目录,点击“Git Bash Here”,打开git命令行。
第二步:按照github新建仓库上的文档提示,提交项目:
1.在命令行中,输入“git init”,使Test文件夹加入git管理;
2.输入“git add .”(不要漏了“.”),将Test文件夹全部内容添加到git。
3.输入“git commit -m "first commit"”(“git commit -m "提交信息"”)
4.输入“git remote add origin https://github.com/dwl99github/Test.git”(git remote add origin 你自己的https地址),连接你的guthub仓库(预先创建好的仓库)。
5.输入“git push -u origin master”,上传项目到Github。这里会要求输入Github的账号密码,按要求输入就可以。
(第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来)

下次再推送不需要 -u参数:git push origin master

【git remote set-url origin URL】 更换远程仓库地址,URL为新地址。

仓库路径查询:git remote -v
删除远程仓库:git remote rm origin(断开关联)

git文件换行符处理,解决"warning: LF will be replaced by CRLF"
#提交时转换为LF,检出时转换为CRLF
$ git config --global core.autocrlf true
详解:https://www.jianshu.com/p/450cd21b36a4

#本地仓库创建新分支并关联到远程仓库分支
git checkout -b 新分支名 origin/master

MyEclipse从Github导出导入项目文件出现cannot open git-upload-pack
https://blog.csdn.net/Soul_wh/article/details/79930463
使用myeclipse2017,JDK1.8

分支操作:
创建分支:git branch aaa(分支名称)
删除分支:git branch -d aaa
切换分支:git checkout master
创建并切换到新分支:git checkout -b 新分支名

$ git branch aaa

Administrator@USER-20160308FU MINGW64 /e/bak/study/git/HelloGit (master)
$ git branch
  aaa
* master

Administrator@USER-20160308FU MINGW64 /e/bak/study/git/HelloGit (master)
$ git checkout aaa
Switched to branch 'aaa'

Administrator@USER-20160308FU MINGW64 /e/bak/study/git/HelloGit (aaa)
$ git checkout master
Switched to branch 'master'

Administrator@USER-20160308FU MINGW64 /e/bak/study/git/HelloGit (master)
$ git branch -d aaa
Deleted branch aaa (was b590a8e).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值