git同步上傳的幾個命令

git pull origin master      //同步遠程倉庫和本地倉庫

git add .    //添加修改或新增的文件到保存到暫存區

git commit -m 'some message about the change file'  // 將暫存區裏的東西提交到本地庫版本

git push origin master  //提交到遠程倉


git remote add origin xxxxxx     //遠程倉庫名        更改分支



git remote -v   //分支信息

git config -l    //查看配置信息




git 衝突error: your local changes to the following files would be overwritten by merge......

    如果希望保留生產服務器上所做的改動,僅僅併入新配置項:

git stash

git pull

git stash pop

然後可以使用git diff -w +文件名 來確認代碼自動合併的情況.

如果希望用代碼庫中的文件完全覆蓋本地工作版本. 方法如下:

git reset --hard

git pull



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