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. c语言-01背包问题

    01背包问题 问题:有N件物品和一个容量为V的背包.第i件物品的费用是c[i],价值是w[i].求解将哪些物品装入背包可使价值总和最大. 分析: 这是最基础的背包问题,特点是:每种物品仅有一件,可以选 ...

  2. PHPMailer发送邮件乱码

    PHPMailer发送邮件乱码, $mail->CharSet="GB2312";$mail->Encoding = "base64"; 设成这样不 ...

  3. Ubuntu安装教程--Win7系统中含100M保留分区

    1.检查 Win7 保留分区 1)进入 Win7 打开库目录.在左側栏找到"计算机",瞄准点右键选择"管理"菜单: 2)在出来的管理面板左边找到"磁盘 ...

  4. tabhost实现android菜单切换

    做APP项目已经有半个月了.慢慢地熟悉了这个开发环境和开发套路. 虽然是摸着石头过河.但也渐渐看到了水的深度! 作为一个电商项目APP,势必会涉及究竟部菜单条的功能.自己实现这个功能的过程是崎岖的,最 ...

  5. 【python】How to change the Jupyter start-up folder

    Copy the Jupyter Notebook launcher from the menu to the desktop. Right click on the new launcher and ...

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

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

  7. 数据结构之 图论---bfs(邻接表)

    数据结构实验之图论二:基于邻接表的广度优先搜索遍历 Time Limit: 1000MS Memory limit: 65536K 题目描述 给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索( ...

  8. springboot在idea实现热部署

    1.在pom.xml引入热部署devtools依赖 <dependency> <groupId>org.springframework.boot</groupId> ...

  9. WPF之Binding深入探讨 转载:http://blog.csdn.net/fwj380891124/article/details/8107646

    1,Data Binding在WPF中的地位 程序的本质是数据+算法.数据会在存储.逻辑和界面三层之间流通,所以站在数据的角度上来看,这三层都很重要.但算法在3层中的分布是不均匀的,对于一个3层结构的 ...

  10. 【Maven】pom.xml(2)

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...