1. 程式人生 > >Updates were rejected because the remote contains work that you do

Updates were rejected because the remote contains work that you do

cau 需要 倉庫 cnblogs 提交 添加文件 cte ges soft

每次建立新的倉庫,提交的時總會出現這樣的錯誤,真是頭疼,......

直接開始正題,git 提交的步驟:

1. git init //初始化倉庫
2. git add .(文件name) //添加文件到本地倉庫
3. git commit -m "first commit" //添加文件描述信息
4. git remote add origin + 遠程倉庫地址 //鏈接遠程倉庫,創建主分支 5. git push -u origin master //把本地倉庫的文件推送到遠程倉庫 提交之後就會出現以下錯誤 技術分享 要想解決以上錯誤,只需要在4,5之間使用git pull origin master即可 正確步驟:
1. git init //初始化倉庫
2. git add .(文件name) //添加文件到本地倉庫
3. git commit -m "first commit" //添加文件描述信息
4. git remote add origin + 遠程倉庫地址 //鏈接遠程倉庫,創建主分支
5. git pull origin master // 把本地倉庫的變化連接到遠程倉庫主分支
6. git push -u origin master //把本地倉庫的文件推送到遠程倉庫 OK 搞定,回家吃飯!!

Updates were rejected because the remote contains work that you do