Start with Git small problem Solving Memo

Source: Internet
Author: User

Use Git for the first time today using git push times wrong

No refs in common and none specified; Doing nothing.
Perhaps you should specify a branch such as ' master '.
Fatal:the remote end hung up unexpectedly
Error:failed to push some refs to ' ssh://[email protected]/adsailer.git '

Haha, please don't panic. This is git can't find the version you're submitting.

1 commit git content git commit-a

2 Create. Gitignore put the ignored files

Example

. idea/*
runtime/*
. Ds_store

git Add. Gitignore

git Add.

Git commit-a

3 Git push-u Origin master Yes

Two Create a library

mkdir "directory Name" #创建目录.

Git–bare init #这样就创建完必一个空库. No more cloning directories.

Finally, the Git directory that you create in general is ended with ". Git". Well, there's nothing mysterious about that.

Tri-Fetch library file

git clone xxxx://Address

Git can fetch libraries based on different protocols. For example, file, HTTP, git and so on as long as the support can be provided. For example, use a local file to fetch the library.

git clone file:///home/viweei/src/xxx.git

Iv. Submission of documents

Git is no more complicated than SVN when extracting files, adding files, and deleting files. It was only when I started to use it that I was making mistakes.

Add File

When extracted from the library, add a new file FUCK.txt. and add it to the library.

Touch fuck.txt #创建 fuck file.

git add * #这里的 "*" is just a wildcard character and can be used directly with a filename.

Git commit–m "Fill in the extracted logs here"

A simple two-step process to extract the files into a local repository, similar to SVN. But a little different is when the commit is executed, VI displays the submission information



Start with Git small problem Solving Memo

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.