git 空项目初次提交项目命令记录

Command line instructions

You can also upload existing files from your computer using the instructions below.

Git global setup
bash 复制代码
git config --global user.name "demo"
git config --global user.email "demo@qq.com"
Create a new repository
bash 复制代码
git clone git@gitlab.xxx.com:workdemo/musicplayer.git
cd musicplayer
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Push an existing folder
bash 复制代码
cd existing_folder
git init
git remote add origin git@gitlab.xxx.com:workdemo/musicplayer.git
git add .
git commit -m "Initial commit"
git push -u origin master
Push an existing Git repository
bash 复制代码
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.xxx.com:workdemo/musicplayer.git
git push -u origin --all
git push -u origin --tags
相关推荐
Rabbit_QL5 小时前
【Git 报错处理】`remote origin already exists` 是什么意思?
git
陈佬昔没带相机7 小时前
GitHub clone 不动、pip 卡住、brew 转圈?一份指南搞定
git·npm
CoovallyAIHub11 小时前
15K Star中文首发!$5部署一个会自我进化的私人Agent——NousResearch开源Hermes Agent
git·架构·github
无限进步_12 小时前
【C++】巧用静态变量与构造函数:一种非常规的求和实现
开发语言·c++·git·算法·leetcode·github·visual studio
降临-max12 小时前
Git 协同开发与冲突解决
笔记·git
高志小鹏鹏13 小时前
告别“修复 bug”:让别人一眼看懂你的 Commit
git·github·代码规范
Rabbit_QL17 小时前
【Git基础】03——Git 撤销与回退:改错了怎么办
大数据·git·elasticsearch
无限进步_17 小时前
【C++&string】寻找字符串中第一个唯一字符:两种经典解法详解
开发语言·c++·git·算法·github·哈希算法·visual studio
HashFlag17 小时前
Git经典锁报错问题
linux·windows·git·mac
木下~learning18 小时前
零基础Git入门:Linux+Gitee实战指南
linux·git·gitee·github·虚拟机·版本控制·ubunt