Xóa Tất Cả Lịch Sử Commit Trên Git Giữ Lại Commit Hiện Tại

Thế Giới Giải Mã

Quảng Cáo Đầu Bài

Translate

Menu List

  • AAD1 (12)
  • ADD2 (11)
  • ADF2 (3)
  • adsense (4)
  • Ajax (5)
  • Android (32)
  • Angular 2 (59)
  • AngularJS (9)
  • Bảo Vật Quốc Gia (2)
  • Blogger (4)
  • Bootstrap 3 (2)
  • C (7)
  • C# (39)
  • Canvas (1)
  • Castles Abandoned (1)
  • Chiến Tranh Thế Giới 2 (5)
  • Chiến Tranh Việt Nam (12)
  • Command Line (5)
  • CSS (16)
  • Deploy errors (1)
  • Design pattern (8)
  • Điện Tử Vi Mạch (47)
  • Docker (1)
  • Domain (1)
  • eclipse (8)
  • EJB (9)
  • Excel (1)
  • Facebook (1)
  • Games pc (48)
  • giaima (116)
  • Git (5)
  • Google (2)
  • Hack (4)
  • Horror Videos (1)
  • Html (7)
  • java (60)
  • Java Advanced (14)
  • Java Collection (3)
  • Java Core (44)
  • Java Interview Questions (10)
  • JAVA Web Services (8)
  • JavaFX (2)
  • JavaScript (25)
  • Job Search (1)
  • jQuery (22)
  • JSF (7)
  • Json (7)
  • Jsp & Servlet (45)
  • Kiếm tiền online (8)
  • Kiến Thức (1)
  • Legendary and Feng Shui (2)
  • Link Website (6)
  • Linux (9)
  • Management (2)
  • Mobile (1)
  • Mua Bán (1)
  • MVC (1)
  • Mysql (5)
  • NetBeans (1)
  • News (1)
  • Nginx (1)
  • NodeJS (27)
  • QR Code (2)
  • Radio Online (3)
  • ReactJS (17)
  • ReactJS Antd Design (1)
  • ReactJS Notes (6)
  • ReactJS Redux (12)
  • Regex (1)
  • RxJS (1)
  • Shortcut (1)
  • Software (1)
  • spring (4)
  • Spring Boot (4)
  • Sql (23)
  • Struts 1 Framework (8)
  • Struts 2 Framework (27)
  • Swing (39)
  • Thủ thuật (1)
  • tools (11)
  • Tutorial (1)
  • Vietnam War History (8)
  • virus (2)
  • Visual studio (1)
  • Web (18)
  • Wifi (2)
  • Windows Store (47)
  • World War (4)
  • XML (26)
  • Youtube (14)

Total Pageviews

Giai Ma. Powered by Blogger.

03 August 2019

Xóa tất cả lịch sử commit trên git giữ lại commit hiện tại - Delete commits history with git commands - GitHub

By Admin at 3:19:00 PM Git No comments

Phương pháp thứ nhất - First Method

Xóa thư mục .git có thể gây ra các vấn đề trong kho git của chúng bạn. Nếu chúng ta muốn xóa tất cả lịch sử commit, nhưng giữ các code trong tình trạng hiện tại của mình, hãy thử điều này: # Check out to a temporary branch: git checkout --orphan TEMP_BRANCH # Add all the files: git add -A # Commit the changes: git commit -am "Initial commit" # Delete the old branch: git branch -D master # Rename the temporary branch to master: git branch -m master # Finally, force update to our repository: git push -f origin master Điều này sẽ không giữ lại lịch sử các commit cũ. Nhưng nếu điều này không làm việc, hãy thử các phương pháp tiếp theo dưới đây.

Phương pháp thứ hai - Second Method

# Clone the project, e.g. `myproject` is my project repository: git clone https://github/heiswayi/myproject.git # Since all of the commits history are in the `.git` folder, we have to remove it: cd myproject # And delete the `.git` folder: git rm -rf .git # Now, re-initialize the repository: git init git remote add origin https://github.com/heiswayi/myproject.git git remote -v # Add all the files and commit the changes: git add --all git commit -am "Initial commit" # Force push update to the master branch of our project repository: git push -f origin master Chú ý: Bạn có thể cần phải cung cấp các thông tin cho tài khoản GitHub của bạn. ← Newer Post Older Post → Home

0 nhận xét:

Post a Comment

facebook tweeter google linked in rss

Meditation Music , Relaxing Music

Bài đăng nổi bật

  • Video bocah berazil - Horror Videos Video bocah berazil "Warning: Can cause psychological trauma" (Video no sensor di bawah)  Ceritanya : Ini adalah persaingan jual b...
  • 11 quốc gia bị Đức Quốc Xã xâm chiếm và tại sao họ bị xâm chiếm Dưới sự lãnh đạo của Adolph Hitler, Đức xâm chiếm hơn 20 quốc gia ở châu Âu và châu Phi. Lý do cho những cuộc xâm lược này khác nhau giữa ...
  • Vô lăng game BoxKer Model : GT-4 Racing Wheel Giá 600k
  • Mussolini Nhà độc tài nước Ý (Ông bạn vàng của Hitler ) và Người tình Petacci chết với khuôn mặt đáng sợ Thi thể nhà lãnh đạo Benito Mussolini (trái) cùng cô bồ Claratta Petacci sau bị quân du kích Italia hành quyết. Dù đã chết nhưng thi th...
  • Lỗi Font Tiếng Việt JSP Servlet Cách Khắc Phục charset=UTF-8 Với lỗi này có 2 trường hợp: - Thứ nhất lỗi ở trang hiển thị tức index.jsp - Thứ hai lỗi ở Servlet khi Insert vào Database index.jsp ...

Túy Hoa Âm & Nhất Tiễn Mai

Top site

  • Angular-2-training
  • Mergevideo
  • Reactjs Router V5
  • Addaudiotovideo
  • Mp3tovideo
  • Tunestotube
  • Bootstrap Cheatsheet
  • Photo Editor
  • Download Video China Site
  • React Usehooks
  • React Hooks Core
  • iCSS
  • JS Interview
  • Replicate AI
  • Angular Blog
  • Game PS3
  • Kebab Case
  • CSS Polygon
  • CSS Design
  • FE Tool
  • MySQL
  • Thủ Thuật FB
  • Glitch
  • Carbon
  • SSL Config
  • Server World
  • Useweb3
  • Git Branching
  • Rapidapi
  • Algorithm Visualizer
  • JSV 9000
  • Create Slide
  • Giải Phương Trinh
  • Grammar checker
  • Benchmark framework
  • Replicate explore
  • Replicate animesr

Best Friend

  Copyright © Thế Giới Giải Mã | Powered by Google Designed by Duong Huu Dai Tel: 0845.882.882 | Author Lasantha Bandara

BACK TO TOP

Xuống cuối trang

Từ khóa » Xóa Commit Trong Github