git apply

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

转载于:https://www.cnblogs.com/zhidanwang/p/10922731.html

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值