"Git" fatal:this operation must is run in a work tree

Source: Internet
Author: User


Before it is so http://blog.csdn.net/commshare/article/details/20526369, the feeling of thinking is still not very clear.

A new project is being built today, and a warehouse is needed.


The empty warehouse that was created with Git--bare init cannot be git add,

Will complain Fatal:this operation must is run in a work tree.

However, it is said that the use of Git init can.


There are several solutions,

Reference http://blog.sina.com.cn/s/blog_630bf12f0100nl7i.html


Reference Http://stackoverflow.com/questions/1456923/why-am-i-getting-the-message-fatal-this-operation-must-be-run-in-a-work-tree

===============

What I have chosen is:

Warehouse with git--bare init,

and my actual engineering directory with GIT init,git Remote add origin, git add a file, git commit, git push,

The remote warehouse is OK.

With Gitweb can also be smooth to see.

==================


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.