Git && GitHub (ii)

Source: Internet
Author: User

1. Delete git rm **.html "If the files in the workspace are not deleted, the files in the staging area will not be deleted, you must first remove the workspace"

git rm--cached **.html "This is a no-delete workspace to delete only staging area"

git rm-f **.html "This will remove both staging area and workspaces at the same time."

2, restore, if accidentally deleted the work area files, to restore the first use git log to find his corresponding ID and then run

git checkout ID name file name "restore version Specify a single file"

git reset--hard ID name "restore version is not for specified file"

git reset--hard head^ "restore the previous version can also specify the first few versions of restore such as restore the first two git reset--hard head~2"

Git reflog "found the version ID that was restored because it was not found by using git log, and then restored with git reset--hard ID name"

3. Sync to remote Repository

Open the local GitHub tool to view the configuration options to see if he's connected to a git account.

Use git remote command to see the remote repository naming default is Orgin

You can also use Git remote-v to view the address of a remote repository

Then the push command is: Git push origin (remote repository name) Master (Remote Repository Branch)

And then refresh on GitHub to see the uploaded files.

4. If you want to give your peers access to your GitHub permissions, use the following actions

Then you create a group project

Last designated person access

5, another person to download the uploaded version of the file code with the git clone and URL so that it can be downloaded from the server down

6. Conflict problems in development "developer uploaded code is out of sync" pull the conflicting files down with git fetch

Then use git diff master Origin/master to compare the conflicting content.

Merge conflicts again git merge origin/master trade-offs

Then commit git commit-a-M "YUJSSDSD"

Finally, with git pull, he's just going to skip the above and just cover your local code with the cloud code.

Git && GitHub (ii)

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.