I can't commit (your branch is up-to-date with 'origin/master')

一世执手 提交于 2019-12-12 20:28:14

问题


I created a project on gitlab and i added a user as developer, So my colleague clone the project correctly and he created a new file but when he try to commit with the following command :

git commit -a -m "update" 

he got this message :

any explanation and help ?


回答1:


after you do

  • git init

if you want submit all of you file code just type

  • git add .

after that you can do

  • git commit -m "First commit"

next ->

  • git remote add origin remote repository URL

in the end,

  • git push origin master

hope it's help.

more useful reference -> github docs existing project




回答2:


You have a new file in your project. For any new file, you need to add it by running git add . and then run your commit message. git commit -a doesn't let you commit any new files that you haven't told git to track yet.



来源:https://stackoverflow.com/questions/39605021/i-cant-commit-your-branch-is-up-to-date-with-origin-master

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!