git简单命令

简易的命令行入门教程:

Git 全局设置:

git config --global user.name "yyyyjinying"

git config --global user.email "12343343@qq.com"

创建 git 仓库:

mkdir wx-project

cd wx-project

git init

touch README.md

git add README.md

git commit -m "first commit"

git remote add origin https://gitee.com/yyyyjinying/wx-project.git

git push -u origin "master"

已有仓库

cd existing_git_repo

git remote add origin https://gitee.com/yyyyjinying/wx-project.git

git push -u origin "master"

问题

commit or discard the untracked or modified content in submodules)

状态解读:在当前文件夹内部存在其它的.git文件

解决办法:找到其它的.git文件,删除后重新 add commit

因为之前的项目有.git,后面又提交到新的仓库,出现了子模块,所有需要将多余的.git文件删除,ls -a && rm -rf .git

相关推荐
Irene19911 天前
查看是否已安装 Git 的方法
git
my_power5201 天前
检出git项目到android studio该如何配置
android·git·android studio
安果移不动1 天前
Git 实战:如何优雅地撤销历史中的某一个 Commit?
git
啥都不懂的小小白1 天前
Git 入门指南:从零开始掌握版本控制
git
AI逐月1 天前
Git 彻底清除历史记录
大数据·git·elasticsearch
有什么东东1 天前
Windows安装git教程以及初步使用
git
不爱吃米饭_1 天前
Gitea 轻量级的Git方案 - Gitlab的替代品
git·gitlab·gitea
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2025-12-15)
git·ai·开源·llm·github
大柏怎么被偷了1 天前
【Git】远程操作
git
studytosky1 天前
Linux 基础开发工具(3):Git 控制与 GDB 调试实用指南
linux·运维·服务器·网络·数据库·git