zoukankan      html  css  js  c++  java
  • 【git基本操作】总结

    "git fetch

    GitLab: Your account has been blocked.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights" ??这是因为本机的仓库连接不到远程库了。优先用http,少用ssh。

    解决办法:

    git remote rm origin
    git remote add origin [http://xxxxx.xxx.git]

    查看当前全部配置

    git config -l

    全局级配置,如果没有仓库级别的特殊配置,默认读取这个配置

    git config --global user.name "name" 
    git config --global user.email "email" 

    仓库级配置,一般一个项目配置一次

    git config user.name "name" 
    git config user.email "email" 

    关联远程完全空白项目

    #git初始化 
    git init 
    #设置remote地址 
    git remote add origin 地址  
    git add .  
    git commit -m "注释" 
    git push -u origin master

    分支

    删除一个分支:

    git branch -d name

    创建一个远程分支:

    git checkout -b develop
    git push origin develop:develop(本地名:远程名)

    版本回退

    git reset --hard HEAD^   退到上一个版本
    git reset --hard HEAD^^ 退到上上一个版本
    git reset --hard commit_id 退到某一个版本
  • 相关阅读:
    在Windows Phone应用中使用Google Map替代Bing Map
    《从入门到精通:Windows Phone 7应用开发》
    判断最小割的唯一性
    ASP.NET页面生命周期
    SQL排序
    window.open
    VS2008中英文转换
    asp.net下载文件的常用方法
    TSQL Convert转换时间类型
    TreeView
  • 原文地址:https://www.cnblogs.com/ldy-miss/p/9964780.html
Copyright © 2011-2022 走看看