Git 本地代码提交并关联远程仓库

2018-08-21  本文已影响9人  ADVANCE_ae

1. git remote add origin https://xxx.git

2.git add . (添加本地代码)     git commit -m "你的本地代码"  (提交本地代码)

3. git push --set-upstream origin master 即可成功将本地代码推送到远程并作为master分支  或者 git push -u origin master

Command line instructions

Git global setup

git config --global user.name "xxx"

git config --global user.email "xxx@xxx.com"

Create a new repository

git clone https://xxx.git
cd xxx
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder or Git repository

cd existing_folder
git init
git remote add originhttps://xxx.git
git add .
git commit
git push -u origin master

上一篇下一篇

猜你喜欢

热点阅读