技术栈

本地项目push到git

2018_XWJ2025-06-14 3:01

cd /home/user/project

git init

添加远程仓库地址

git remote add origin https://github.com/user/repo.git

创建并切换到新分支

git checkout -b swift

添加文件到暂存区

git add .

git commit -m "swift训练评测"

git push -u origin swift ---force #首次

git push origin swift ---force #非首次

上一篇:C语言 — 通讯录模拟实现
下一篇:git merge合并分支push报错:Your branch is ahead of ‘xxx‘ by xx commits.
相关推荐
小前端学徒
2 小时前
重新修改未提交到远程分支不是最后一次commit的内容
git
执键行天涯
3 小时前
idea中已经被git缓存追踪的文件,如何让git重新忽略
git·缓存·intellij-idea
hkhkhkhkh123
3 小时前
Git push 失败(remote unpack failed: Missing tree)解决方案
linux·git
拾贰_C
4 小时前
【anaconda】anaconda安装配置,git安装配置以及pytorch安装
人工智能·pytorch·git
Just_Paranoid
6 小时前
【Gerrit Patch】批量下载 Gerrit 提交的 Patch
git·gerrit·shell·patch
T - mars
20 小时前
Pycharm中使用git
ide·git·pycharm
jason_yang
21 小时前
Workspace搭建Vue3+组件分离的Monorepo项目
git·npm·前端工程化
鸽鸽程序猿
1 天前
【Git】Git 简介及基本操作
git
ziyue7575
1 天前
idea终端添加git-bash,支持linux的shell语法
linux·git·bash·idea·软件
风也温柔☆
2 天前
idea 拉取分支git pull报错 The branch to pull from should be selected
git·intellij-idea·debug·git pull
热门推荐
01Multisim使用教程详尽版--(2025最新版)02UV 工具安装与国内镜像源配置指南03GitHub 镜像站点04UV安装并设置国内源0546个Nano-banana 精选提示词,持续更新中06Spec-Kit 使用指南07VsCode远程Copilot无法使用Claude Agent问题08KGG转MP3工具|非KGM文件|解密音频09保姆级教程:手把手教你用Dify实现完美多轮对话(附Chatflow和提示词)10Linux下V2Ray安装配置指南