EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

GitBash_在本地創建一個Git倉庫

在GitBash中

cd /你的檔案目錄
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/你的用戶名/your-repository-name.git
git push -u origin main

 

 

命令説明

git init

默認會產生一個叫master的主幹,我們可以在init的時候添加參數來讓第一個主幹叫main

git init --initial-branch=main

*(注意,--initial-branch是固定參數,不是名字+branch的組合)


也可以全局設置保證初始化的時候,生成的名爲main的主幹

git config --global init.defaultBranch main

 

當然,你也可以選擇修改分支:

git branch -m [目標分支] [更名后分支]

 

 

→上一篇:GitBash_查看以及设置當前用戶名和郵箱

→下一篇:GitBash關於Remote的操作

→返回目錄:GitBash使用手冊

This article was last edited at 2024-07-07 05:12:58

Today's comments have reached the limit. If you want to comment, please wait until tomorrow (UTC-Time).

There is 16h08m32s left until you can comment.