Git - 基础介绍
2023-09-14 09:00:40 时间
1 - Git
Git - HomePage Git - CHEAT SHEET
开源的分布式版本控制系统,用于敏捷高效地管理项目版本。
下载与安装Git
https://git-scm.com/downloads
https://git-for-windows.github.io/
Git - The Simple Guide
- https://backlog.com/git-tutorial/cn/
- 互动教程:https://learngitbranching.js.org/
- https://www.atlassian.com/git/tutorials
- https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet
Git帮助信息
# Display the version of git.
git version
# Display the brief help
git <COMMAND> -h
# Display help for specific subcommand or concept.
git help <COMMAND/CONCEPT>
git <COMMAND/CONCEPT> --help
git help # Prints the synopsis and a list of the most commonly used commands.
git help git # Display the git man page.
git help --help # Display the help of 'git help'
git help --all # Print all available commands on the standard output.
git help --guide # Print a list of the useful Git guides on the standard output.
Git代理设置
设置全局代理
git config --global https.proxy https://10.144.1.10:8080
git config --global http.proxy http://10.144.1.10:8080
去除全局代理
git config --global --unset http.proxy
git config --global --unset https.proxy
2 - Git及GitHub简单使用示例
设置全局登录名称和邮箱
git config --global user.name "<Login name>"
git cofnig --global user.email "<Email address>"
创建SSH Key
ssh-keygen -t rsa –C "<Email address>"
配置GitHub
- 如果使用ssh方式,配置ssh认证。
- 创建git仓库,确认git仓库信息, 例如:https://github.com/AnlivenCoding/test.git
创建本地git仓库并推送
$ cd /d/Anliven-Running/Zen/test/ # 进入目录
$ echo "# PythonLearning" >> README.md # 创建说明文件
$ git init # 将当前目录变成本地Git仓库
$ git add * # 添加所有文件到本地仓库的暂存区(Index/Stage)
$ git commit -m "first commit" # 提交文件到本地仓库
$ git remote add origin https://github.com/AnlivenCoding/test.git # 关联本地仓库和远端仓库
$ git push -u origin master # 第一次推送本地仓库内容到远端仓库master分支
$ git push origin master # 第一次推送本地仓库内容到远端仓库master分支
克隆远端仓库到本地
$ git clone https://github.com/AnlivenCoding/test.git
Cloning into 'test'...
remote: Counting objects: 237, done.
remote: Compressing objects: 100% (217/217), done.
remote: Total 237 (delta 11), reused 237 (delta 11), pack-reused 0
Receiving objects: 100% (237/237), 153.18 KiB | 138.00 KiB/s, done.
Resolving deltas: 100% (11/11), done.
Checking connectivity... done.
3 - 参考信息
相关文章
- Centos6.8搭建Git服务(git版本可选)
- [Git] git merge之squash
- 算法基础-理论代码
- Git 代码更新:git fetch 和 git pull 的区别
- C基础--函数指针的使用
- Java实现 基础算法 求100以内的质数
- C#编程总结(二)多线程基础
- django框架基础-路由系统-长期维护
- 【学习总结】Git学习-GIT工作流-千峰教育(来自B站)
- [Practical Git] Configure global settings with git config
- [Git] A better git process
- [Practical Git] Clean up commits with git rebase
- SQL基础【十六、Union】
- Python基础——PyCharm版本——第一章、PyCharm工具的安装与使用
- 〖大前端 - 基础入门三大核心之JS篇③〗- 掌握 Javascrip 的变量
- MATLAB | 面向对象编程基础 | 类的创建及运算符重载
- 編程的本質:编程也应像其他科学和工程领域一样基于坚实的数学基础
- 线程基础:线程池(5)——基本使用(上)
- 华为防火墙基础自学系列 | VdPdNd概述
- Linux基础命令-stat显示文件的状态信息
- Git知识总览(四) git分支管理之rebase 以及 cherry-pick相关操作
- 【软考】信息系统开发基础 - 信息系统/软件开发方法
- 【Spring Boot】Spring Boot框架基础介绍
- 05 verilog基础语法-运算符
- SQL注入渗透与攻防(五)之基础防御