Git入门详解

Git入门详解

1. Git安装

2. Git配置

简易的命令行入门教程:

  • Git 全局设置:
bash 复制代码
git config --global user.name "yourname"
git config --global user.email "your email"

3. Git使用

  • 创建 git 仓库:
bash 复制代码
mkdir circular_spot_detect
cd circular_spot_detect
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/start_2022/circular_spot_detect.git
git push -u origin "master"
  • 已有仓库?
bash 复制代码
cd existing_git_repo
git remote add origin https://gitee.com/start_2022/circular_spot_detect.git
git push -u origin "master"
  • 若想维护自己的仓库或者更新代码

    • 如果是在新的电脑上进行更新,则需要:
    bash 复制代码
    #第一次需要下载代码,下载链接即HTTPS链接
    git clone xxxxx.git 
    
    #然后进行代码或者文件的增加与删减
    -------
    • 更新代码
    bash 复制代码
     #每次上传时需要先pull一下
    git pull 
     
    #然后添加更改
    git add .
    #添加合并注释
    git commit -m "更改了。。。"
    
    #上传:
    git push
  • 上传代码到分支 branch

bash 复制代码
#查看一下分支结构
git branch

#如果没有你自己的分支,新建分支
git checkout -b 分支名称

#已有分支,切换到当前分支
git checkout 分支名称

#将要上传的文件提交
git add .

#提交文件
git commit -m '提交的描述'

#push到远程仓库
git push origin 你的分支名称
相关推荐
热爱生活的五柒1 分钟前
在有真实标签 (Ground Truth) 的情况下,常用的指标有哪些?聚类指标有哪些?
python·指标
superman超哥2 分钟前
仓颉语言智能指针深度实战:突破 GC 与所有权的边界
c语言·开发语言·c++·python·仓颉
八月的雨季 最後的冰吻11 分钟前
FFmepg-- 39-ffplay源码-ffplay 播放器中视频输出和尺寸变换
c++·音视频
Elaine33612 分钟前
【基于 Scikit-learn 本地数据集的垂直领域词云生成】
python·机器学习·nlp·scikit-learn·词云
38242782713 分钟前
python:mysql数据库
数据库·python·mysql
中科院提名者17 分钟前
KNN实战进阶:模型评估、Scikit-learn实现与Numpy手动编码
python·numpy·scikit-learn
AuroraWanderll21 分钟前
类和对象(四):默认成员函数详解与运算符重载(下)
c语言·数据结构·c++·算法·stl
-拟墨画扇-21 分钟前
Git | 文件修改操作
大数据·git·gitee·github·gitcode
2401_8414956421 分钟前
【LeetCode刷题】杨辉三角
数据结构·python·算法·leetcode·杨辉三角·时间复杂度·空间复杂度
-拟墨画扇-23 分钟前
Git | 版本控制操作
大数据·git·gitee·github