GIT 初始化命令

快速設置— 如果你知道該怎么操作,直接使用下面的地址

Git 全局設置:

git config --global user.name "herolf4c"
git config --global user.email "450108416@163.com"</pre>

創(chuàng)建 git 倉庫:
mkdir tmp
cd tmp
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/herolf4c/tmp.git
git push -u origin master</pre>

已有倉庫?
cd existing_git_repo
git remote add origin https://gitee.com/herolf4c/tmp.git</pre>

git init
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
ssh-keygen -t rsa -C "450108416@163.com"
cat id_rsa.pub

git add .
git commit -m "first commit" //添加文件描述信息
git remote add origin git@github.com:herolf/asm_function-for-C.git
git pull origin master
git push -u origin master

正確步驟:

  1. git init //初始化倉庫

  2. git add .(文件name) //添加文件到本地倉庫

  3. git commit -m "first commit" //添加文件描述信息

  4. git remote add origin + 遠程倉庫地址 //鏈接遠程倉庫,創(chuàng)建主分支

  5. git pull origin master // 把本地倉庫的變化連接到遠程倉庫主分支

  6. git push -u origin master //把本地倉庫的文件推送到遠程倉庫

快速設置— 如果你知道該怎么操作,直接使用下面的地址

HTTPS

SSH

<input class="one_click_select" id="project_clone" name="project_clone" readonly="readonly" type="text" value="git@gitee.com:herolf4c/jiazheng.git" style="box-sizing: inherit; color: rgb(157, 157, 157); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 13px; line-height: 1.2142em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Liberation Sans", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, SimSun, "WenQuanYi Zen Hei Sharp", sans-serif; margin: 0em; display: inline-block; padding-top: 0.67861em; padding-right: 2.82142em !important; padding-bottom: 0.67861em; padding-left: 1em; border: 1px solid rgb(220, 227, 232); border-radius: 2px; -webkit-appearance: none; width: 320px; outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); text-align: left; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(245, 245, 245) !important; transition: background-color 0.2s ease 0s, box-shadow 0.2s ease 0s, border-color 0.2s ease 0s, -webkit-box-shadow 0.2s ease 0s; box-shadow: none; cursor: text;">

我們強烈建議所有的git倉庫都有一個README, LICENSE, .gitignore文件

Git入門?查看 幫助 , Visual Studio / TortoiseGit / Eclipse / Xcode 下如何連接本站, 如何導入倉庫

簡易的命令行入門教程:

Git 全局設置:

git config --global user.name "herolf4c"
git config --global user.email "450108416@163.com"</pre>

創(chuàng)建 git 倉庫:

mkdir jiazheng
cd jiazheng
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@gitee.com:herolf4c/jiazheng.git
git push -u origin master</pre>

已有倉庫?

cd existing_git_repo
git remote add origin git@gitee.com:herolf4c/useful_code.git
git push -u origin master</pre>

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容