github上传-远程仓库管理

https://github.com/


1.在Windows上安装Git
2.你的名字和Email地址

 

1.giithup删除远程库
2.giithup远程库关联本地
3.giithup创建与合并分支


3.本地版本库

  • git init命令把这个目录变成Git可以管理的仓库
  • F:\MyRepository
  • 工作区,暂存区

4.op
op1添加+提交

  • git status
  • git add readme.txt
  • git commit -m "wrote a readme file"
  • git push -f origin master

查看:

http://htmlpreview.github.io/?
https://github.com/lanczh/works/blob/master/web/index.html

op2运行git status命令看看结果

  • git status
  • git rm


远程仓库
我们根据GitHub的提示,在本地的learngit仓库下运行命令
1.方法一
https://github.com/lanczh/works.git
本地版本库
妈妈再也不用担心我的硬盘了


CodeReposition
F:\CodeReposition


ssh -T git@github.com
git clone https://github.com/lanczh/works.git

2.方法二
将本地的已有项目关联到github上的新的项目上
F:\CodeReposition下执行
git remote add origin https://github.com/lanczh/works.git

我们创建dev分支,然后切换到dev分支
git checkout -b branch0822 //相当于以下两条命令:git branch dev/ git checkout dev


然后,用git branch 命令查看当前分支:

  • git branch
  • git checkout master
  • git merge dev
  • git branch -d dev


git 冲突

  • git status也可以告诉我们冲突的文件
  • Git用<<<<<<<,=======,>>>>>>>标记出不同分支的内容,我们修改如下后保存:
  • 用git log --graph命令可以看到分支合并图
  • git log --graph --pretty=oneline --abbrev-commit

https://github.com/lanczh/works/blob/master/pos/index.html



















posted @ 2017-08-29 11:02  alan-alan  阅读(112)  评论(0编辑  收藏  举报