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. EF Core使用SQL调用返回其他类型的查询 ASP.NET Core 2.0 使用NLog实现日志记录 CSS 3D transforms cSharp:use Activator.CreateInstance with an Interface? SqlHelper DBHelper C# Thread.Abort方法真的让线程停止了吗? 注意!你的Thread.Abort方法真

    EF Core使用SQL调用返回其他类型的查询   假设你想要 SQL 本身编写,而不使用 LINQ. 需要运行 SQL 查询中返回实体对象之外的内容. 在 EF Core 中,执行该操作的另一种方法 ...

  2. HDU 1085 Holding Bin-Laden Captive!(母函数,或者找规律)

    Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Ja ...

  3. 阿里云serverMySQL无法连接问题解决纪实

    作者:fbysss QQ:溜酒酒吧酒吧吾散 blog:blog.csdn.net/fbysss 声明:本文由fbysss原创,转载请注明出处 背景: 在调试程序的时候,发现数据库訪问相关的环节出现错误 ...

  4. zoj1232Adventure of Super Mario(图上dp)

    题目连接: 啊哈哈.点我点我 思路: 这个题目是一个图上dp问题.先floyd预处理出图上全部点的最短路,可是在floyd的时候,把可以用神器的地方预处理出来,也就是转折点地方不能为城堡..预处理完成 ...

  5. 利用python暴力破解ssh

    # -*- coding:utf-8 -*- #python 2.7 import optparse,sys,threading import pexpect PROMPT = ['#','>' ...

  6. DSL 如何工作

    DSL 如何工作 http://computer.howstuffworks.com/dsl.htm 当你连接到因特网时,你可能是通过一个调制解调器 (modem),或办公室的局域网,或者一个电缆调制 ...

  7. 翻译:A Tutorial on the Device Tree (Zynq) -- Part II

    A Tutorial on the Device Tree (Zynq) -- Part II 设备树结构 Zynq的设备树如下: /dts-v1/; / { #address-cells = < ...

  8. HTML CSS 编码规范

    返璞归真,代码规范也是一门艺术 黄金定律 永远遵循同一套编码规范 -- 可以是这里列出的,也可以是你自己总结的.如果你发现本规范中有任何错误,敬请指正.通过open an issue on GitHu ...

  9. setTimeout 传递的方法

    function waitExe(param){ if(time < 20){ time ++; $("#content").html(time); var self=thi ...

  10. JVM Safepoint 安全点

    一.什么是安全点: 在可达性分析算法中查找存活的对象,首先要找到哪些是GC Roots: 有两种查找GC Roots的方法: 一种是遍历方法区和栈区来查找(保守式GC): 一种是通过OopMap的数据 ...