如何把本地的仓库推送到远程仓库? #1

Closed
opened 2023-12-12 13:47:50 +08:00 by suneshone · 1 comment
Owner

首先运行git remote add <shortname> <url>添加远程仓库

git remote add origin git@git.suneshone.com:suneshone/obscuredSubtitles.git

可以通过运行 git remote 命令列出你指定的每一个远程服务器的简写,你也可以指定选项 -v,会显示需要读写远程仓库使用的 Git 保存的简写与其对应的 URL。

然后运行 git push <remote> <branch>将本地仓库推送到远程仓库

比如将 master 分支推送到 origin 服务器

git push origin master

不过需要在远程仓库的服务器上添加ssh公钥。生成命令 ssh-keygen -o

首先运行`git remote add <shortname> <url>`添加远程仓库 ```shell git remote add origin git@git.suneshone.com:suneshone/obscuredSubtitles.git ``` 可以通过运行 `git remote` 命令列出你指定的每一个远程服务器的简写,你也可以指定选项 `-v`,会显示需要读写远程仓库使用的 Git 保存的简写与其对应的 URL。 然后运行 `git push <remote> <branch>`将本地仓库推送到远程仓库 比如将 master 分支推送到 origin 服务器 ```shell git push origin master ``` > 不过需要在远程仓库的服务器上添加ssh公钥。生成命令 `ssh-keygen -o`
Author
Owner

有类似git push -u origin master 的推送,其中 -u 的作用是以后可以直接输入git push进行推送,不必再带上后面的内容。

有类似`git push -u origin master` 的推送,其中 `-u` 的作用是以后可以直接输入`git push`进行推送,不必再带上后面的内容。
suneshone added reference master 2023-12-12 13:55:34 +08:00
suneshone changed reference from master to refs/tags/v1.0 2023-12-12 13:55:48 +08:00
suneshone added this to the 学习git的使用 project 2023-12-12 13:56:03 +08:00
suneshone self-assigned this 2023-12-12 13:56:10 +08:00
suneshone started working 2023-12-12 13:56:17 +08:00
suneshone stopped working 2023-12-12 13:56:33 +08:00
16 seconds
suneshone added the due date 2023-12-12 2023-12-12 13:59:21 +08:00
suneshone added the
question
label 2023-12-12 15:18:43 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Total Time Spent: 16 seconds
suneshone
16 seconds
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

2023-12-12

Dependencies

No dependencies set.

Reference: suneshone/obscuredSubtitles#1
No description provided.