Restore and operate CentOSGit

Source: Internet
Author: User
$ Gitlog -- graph -- oneline $ gitreset -- hard version uses reflog to save the wrong reset [jackluo @ localhostdemo] $ gitreflogshowmaster | head-5 reset $ gitreset -- hardmaster @ {2} ls $
$ Git log -- graph -- oneline $ git reset -- hard version number

Use reflog to save wrong reset

[Jackluo @ localhost demo] $ git reflog show master | head-5
Reset

$ Git reset -- hard master @ {2}

Ls

$ Git log -- oneline

Git reflog show master | head-5

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

Git clean-nd delete

Git clean-fd force delete

Git status-s

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

Git stash: save and restore the progress

Git stash list display progress list

Git stash pop resumes the latest work progress

Git stash save "message..." save the progress and specify instructions

Git stash drop deletes a storage progress

Git stash clear: Progress of deleting all storage

Git stash branch create branch based on progress

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

View historical submission records

Git log -- graph -- pretty = raw refs/stash-2

Git stash apply stash @ {1} recovery progress

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

Git commit-a-m "is lazy and can be submitted directly using the-a parameter ."

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

Create an archive file

$ Git archive-o latest.zip HEAD

Only directories src and doc are set to partial.tar.

Git archive-o partial.tar HEAD src doc

Create an archive based on mileage v1.0 and add the directory prefix 1.0 for the archive files

$ Git archive -- format = tar -- prefix = 1.0/v1.0 | gzip> foo-1.0.tar.gz

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

Submitted many times from history

Git rev-list HEAD | wc-l

Related Article

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.