DOTNET_INTERNALS Telegram 72
چیکار کنیم وقتی به اشتباه تو برنچ main پوش میکنیم؟!

دیروز داشتم کد میزدم و پوش میکردم یهو دیدم که دارم توی برنچ main پوش میکنم!!!

داشتیم pair-programming میکردیم و اصلا حواسم نبود ولی خوب همیشه یه راهی باید باشه، نه؟

باید این مراحل رو انجام بدیم:

1- پیدا کردن کامیت آخرین کامیت درست
git log --oneline
با این دستور تاریخچه کامیت ها رو میتونیم ببینیم
path\to\repo> git log --oneline
e74c0b4 (HEAD -> main) by mistake commit 2
d86e63f by mistake commit 1
ed658f3 latest good commit
7975f4e previous commits


2- تغییر برنج به کامیت درست
git reset --hard <commit-hash>

طبق تاریخچه بالا میخوایم به کامیت ed658f3 برگردیم پس:
git reset --hard ed658f3


3- پوش کردن تغییرات
با این دستور برنچ main رو آپدیت میکنیم
git push origin main --force

و تمام!

خوب چندتا سوال پیش میاد؟
1- چرا من تونسته بودم مستقیم روی برنچ main پوش کنم؟
چون ادمین ریپو هستم

2- خوب چرا پوش رو نبستی روی main؟
چون گیتاپ اگر بخوای Rule ست کنی برای ریپوی خصوصی باید گیتاپ Enterprise داشته باشی
👍22



tgoop.com/dotnet_internals/72
Create:
Last Update:

چیکار کنیم وقتی به اشتباه تو برنچ main پوش میکنیم؟!

دیروز داشتم کد میزدم و پوش میکردم یهو دیدم که دارم توی برنچ main پوش میکنم!!!

داشتیم pair-programming میکردیم و اصلا حواسم نبود ولی خوب همیشه یه راهی باید باشه، نه؟

باید این مراحل رو انجام بدیم:

1- پیدا کردن کامیت آخرین کامیت درست
git log --oneline
با این دستور تاریخچه کامیت ها رو میتونیم ببینیم

path\to\repo> git log --oneline
e74c0b4 (HEAD -> main) by mistake commit 2
d86e63f by mistake commit 1
ed658f3 latest good commit
7975f4e previous commits


2- تغییر برنج به کامیت درست
git reset --hard <commit-hash>

طبق تاریخچه بالا میخوایم به کامیت ed658f3 برگردیم پس:
git reset --hard ed658f3


3- پوش کردن تغییرات
با این دستور برنچ main رو آپدیت میکنیم
git push origin main --force

و تمام!

خوب چندتا سوال پیش میاد؟
1- چرا من تونسته بودم مستقیم روی برنچ main پوش کنم؟
چون ادمین ریپو هستم

2- خوب چرا پوش رو نبستی روی main؟
چون گیتاپ اگر بخوای Rule ست کنی برای ریپوی خصوصی باید گیتاپ Enterprise داشته باشی

BY .NET Internals




Share with your friend now:
tgoop.com/dotnet_internals/72

View MORE
Open in Telegram


Telegram News

Date: |

How to Create a Private or Public Channel on Telegram? Matt Hussey, editorial director at NEAR Protocol also responded to this news with “#meIRL”. Just as you search “Bear Market Screaming” in Telegram, you will see a Pepe frog yelling as the group’s featured image. End-to-end encryption is an important feature in messaging, as it's the first step in protecting users from surveillance. Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. Hui said the messages, which included urging the disruption of airport operations, were attempts to incite followers to make use of poisonous, corrosive or flammable substances to vandalize police vehicles, and also called on others to make weapons to harm police.
from us


Telegram .NET Internals
FROM American