git公共項目提交方法

 

1 .  初始化

git init

 

2 .  配置郵箱

《全局》

git config --global user.name "你的名字或暱稱"

git config --global user.email "你的郵箱"

 《...》

git config user.name "你的名字或暱稱"

git config user.email "你的郵箱"

 

3 .  添加項目地址

git remote add origin <你的項目地址>

 

4 . git pull

 

5 . 添加文件

git add .

 

6 . 查看變化狀態:

git status

 

7 . 提交至本地倉庫。

git commit -am 'first commit , init project'

 

8 . 推送

 

git push origin master

 

git push origin master -f    //則在推送時選擇強制推送,強制推送需要執行下面的命令

 

# git branch --set-upstream-to=origin/master master

 

9 . 查看分支。

git branch

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章