GitHub simple way to "use Git bash" _gitbash

Source: Internet
Author: User
Tags git clone

1, the first set up GitHub remote Warehouse "own Baidu, online have a bunch";

2, download the gitbash installed well;

3, into the Gitbash command console, Remote Storage cloning;

Use commands are:

The clone address at the back of git clone https://github.com/XXXXXXXXXXX/XXXXXXXXXX.git//can be found in the GitHub project that you have built, "select Usehttps when choosing Clone"

Wait for the git command to complete the remote code cloning, you can build in the local warehouse inside the clone to see the code;

At this point, you can make your own local code changes to write;

Continue with the following steps when writing is complete;

4, use Git status to see the changes you want to submit "such as a new Readme.txt file," will appear in the following figure:


5, Next is the submission step:

git add readme.txt
git commit-m ' xxxxxxxxx '//later xxxxxxxxx is for versioning, you can add log records at commit
git remote add Origin https:// Github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git
git push Origin master

If you do git remote add Origin https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git, an error occurs:

Fatal:remote origin already exists

Proceed to the next step:

Git remote RM origin

and continue with Git remote add Origin https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git

If push is an error:

error:failed to push som refs ....

Continue using the following command to upload:

Git pull Origin Master

6, a point to note the use of HTTPS link "https://github.com/xxxxxxxxxxx/xxxxxxxxxxxx.git" for cloning and uploading if the file is too large may occur timeout "Fatal:the Remote end Hung up unexpectedly "You can modify the URL at this time to upload using ssh:

STEP1:

Ssh-keygen-t rsa-c "email@domain.com"//Generate a Sshkey based on your mailbox

Once the build succeeds, a private key is saved locally and the public key is placed on the Gitlab:

STEP2:

Cat ~/.ssh/id_rsa.pub//After execution appears to indicate success Ssh-rsa AAAAB3NZAC1YC2EAAAADAQABAAABAQC6ENTGPNGWSTC ....


STEP3:
modify git URL to ssh in remote repository: "Git@server:username/project.git"

Git remote Set-url origin git@gitserver:username/project.git

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.