• Github使用心得


    git中重要的概念:

    • 工作目录(working directory):在工作目录中修改文件,修改后的文件状态是modified,新添加的文件是untracked,通过git add命令将文件保存到staging area中;
    • staging area:保存下次即将提交到git repository中文件的snapshot。文件状态是staged,通过git commit命令提交文件到git repository中;
    • git repository:本地仓库。通过git push命令更新远端服务器仓库,通过git pull命令更新本地仓库。
    开始使用git:
    1. 在本机上安装git,http://progit.org/book/
    2. 使用github充当远端服务器,托管本地代码:www.github.com
    3. 在github上注册好帐号,创建一个仓库,就可以将本地仓库托管上去了
    4. 剩下的就是从原理上学习git,熟练掌握git的常用命令,不懂的就git --help。
    git常用命令:
    • git config :配置git
    • git add:更新working directory中的文件至staging area。git add .更新所有的文件
    • git commit:提交staging area中的文件至git repository中。git commit -m 'message'
    • git status:查看状态
    • git diff:查看改动情况
    • git remote:查看远端服务器别名,加上-v显示url信息
    • git remote add server_url local-alias:添加远端服务器
    • git clone project_url local_alias:拷贝项目到本机中
    • git push server_url/local-alias:更新远端服务器仓库
    • git pull server_url/local-alias:更新本地服务器仓库
  • 相关阅读:
    设计模式(十):Decorator装饰者模式 -- 结构型模式
    设计模式(九):Composite组合模式 -- 结构型模式
    Anagrams
    Gas Station
    Unique Binary Search Trees II
    Trapping Rain Water
    4Sum
    3Sum Closest
    3Sum
    Longest Valid Parentheses
  • 原文地址:https://www.cnblogs.com/yyx1/p/4458354.html
Copyright © 2020-2023  润新知