Common git errors

Source: Internet
Author: User

 ERROR:SRC Refspec Master does not match any.
引起该错误的原因是,目录中没有文件,空目录是不能提交上去的

error: insufficient permission for adding an object to repository database ./objects
服务端没有可写目录的权限

Error tip: Fatal:remote origin already exists.
WORKAROUND: $ git Remote RM origin
Error hint: error:failed to push som refs to ....
Workaround: Git pull Origin master//pull down and push up

GIT init//fulfill this command under the current project program is equivalent to git the current project, and become a body!

git Add.//The current catalog under the code to participate in Git tracking, meaning is to be administered to git, submitted to the local library

git add <file>//Put Git in the current file, commit to git, submit to local repository

Git commit-m "..."//equivalent to write-point submission information

Git remote Add origin git@github.com:ellocc/gittest.git//This corresponds to the specified local library and which item on GitHub is connected

Git push-u origin master//submits the local library to GitHub.

git clone git@github.com:ellocc/gittest.git//Put down the project on GitHub.

Git fetch origin//Get a long-distance update, here can be seen as a preparation to take

git merge origin/master//merge the updated content into the local branch/master

Here is the commit after deleting the file

Git status//can see which files we deleted

git Add. Delete the file after committing to git.

git rm a.c//Delete files

git rm-r gittest//delete a catalog

git reset--hard HEAD rollback to the state before add
Git diff compares the differences between files in the tracking list and files in the file system

(go) git common errors

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.