1. git 安装
 
2.git 与服务器的验证
 
  1.生成ssh
    ssh-keygen -t rsa -C "1107247128@qq.com"
  2.查看生成的pub文件,并把秘钥添加到Git上
  3.测试连接ssh
    ssh -T git@git git@git.lagou.com
  3.设置本机在git中的身份
    git config --global user.name "zhidanwang19910111"
    git config --global user.email "1107247128@qq.com"
  4.创建一个库用来管理代码
    1.git init
    2.git remote add origin "远程库的ssh"
    3.将文件拷贝库
    4.git add .
    5.git commit -m ""
    6.git push -u origin master
    7.git remote -v 查看远程仓库
    8.git remote rm origin 删除远程仓库
  

  5.创建一个分支
    git branch 查看当前有几个分支
    git branch -a 查看全部分支,远程分支会红色表示出来
    git checkout -b "分支名称"
    git checkout 切换分支
    git push origin "分支名称"
 
    git branch -m old_branch new_branch # Rename branch locally 分支重命名
    git push origin :old_branch # Delete the old branch
    git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
  6. 强制回滚
    git reset --hard e377f60e28c8b84158
    git push -f origin master
    git log -3

git apply的更多相关文章

  1. git diff 生成patch, git apply patch 打补丁方法说明,以及分支管理的简单操作。

    git diff 简易操作说明 先git log 查看commit ID, 记录你想要打的补丁的ID 比如说: git log commit 4ff35d800fa62123a28b7bda2a04e ...

  2. git format-patch & git apply & git clean

    一.打补丁 git format-patch & git apply 最近在工作中遇到打补丁的需求,一来觉得直接传文件有些low(而且我尝试了一下,差点把项目代码毁了) ,二来也是想学习一下, ...

  3. git apply、git am打补丁.diff 和 .patch【转】

    本文转载自:https://www.jianshu.com/p/e5d801b936b6 前提: 生成patch: git format-patch -M master 生成指定patch,0163b ...

  4. git apply failed (转载)

    转自:http://blog.csdn.net/aaronzzq/article/details/6955893 git version 1.6.0.4 几个新手刚刚开始接触 Git,为了维护核心仓库 ...

  5. How to create and apply a patch with Git

    Creating a patch file with git is quite easy to do, you just need to see how it’s done a few times. ...

  6. git crate patch and check&apply patch(八)

    root@vmuer-VirtualBox:/opt/myProject# git format-patch master0001-add-c.c.patch root@vmuer-VirtualBo ...

  7. 常look的Git命令

    常用的Git命令   命令  简要说明 git add 添加至暂存区 git add–interactive 交互式添加 git apply   应用补丁 git am  应用邮件格式补丁 git a ...

  8. GIT常用命令笔记

    最近在做了一个自己的项目.两个人合作的,所以需要用到版本管理工具.本来打算学一下自己搭建svn的,后来朋友推荐我用git,免费,流行,好用,逼格.所以就学习了一下.发现这个git与已经使用惯了的svn ...

  9. git stash 用法

    git stash用于将当前工作区的修改暂存起来,就像堆栈一样,可以随时将某一次缓存的修改再重新应用到当前工作区. 一旦用好了这个命令,会极大提高工作效率.   直接举例说明: 1.准备工作,首先初始 ...

随机推荐

  1. mysql添加删除索引,查看某个表的建表语句

    查看某个表的建表语句 :show create table data_statdata; drop index ts on data_statdata; 索引是加速查询的主要手段,特别对于涉及多个表的 ...

  2. 赵雅智_SimpleCursorAdapter

    项目步骤 声明listView控件并获取显示的视图 获取显示的数据 设置显示的adapter 注冊点击事件 详细案例 实现效果: watermark/2/text/aHR0cDovL2Jsb2cuY3 ...

  3. 自定义UISearchDisplayController的“No Results“标签和”Cancel“按钮

    本文转载至 http://www.cnblogs.com/pengyingh/articles/2350154.html - (void)searchDisplayControllerWillBegi ...

  4. HDU 6155 Subsequence Count 线段树维护矩阵

    Subsequence Count Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 256000/256000 K (Java/Oth ...

  5. 网页Html代码优化及分析

  6. es 300G 数据删除 执行计划 curl REST 操作

    es 300G 数据删除 [es union_2017执行计划] [测试执行环境]线上D服务器[测试用例]get:curl -XGET ES:9200/_cat/indices?v post:curl ...

  7. 正则_action

    http://wiki.ubuntu.org.cn/index.php?title=Python%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%93% ...

  8. JasperReport 中文问题解决

    1 运行环境    1.1 JasperReport 3.5    JasperReports 是iReport的核心内容.它是一个强有力的开源报表产生工具,可以将内容输出到屏幕上.打印机或生成PDF ...

  9. java包和javax包的区别

    基本类库和扩展类库 一般的lang,util都放在java.包 servlet放在javax包 以前sun把java中的叫核心库,把javax中的叫扩展库.现在sun已经把java和javax中的都叫 ...

  10. leetcode 684. Redundant Connection

    We are given a "tree" in the form of a 2D-array, with distinct values for each node. In th ...