Telegram Group & Telegram Channel
چیکار کنیم وقتی به اشتباه تو برنچ 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 داشته باشی



tg-me.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:
tg-me.com/dotnet_internals/72

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

However, analysts are positive on the stock now. “We have seen a huge downside movement in the stock due to the central electricity regulatory commission’s (CERC) order that seems to be negative from 2014-15 onwards but we cannot take a linear negative view on the stock and further downside movement on the stock is unlikely. Currently stock is underpriced. Investors can bet on it for a longer horizon," said Vivek Gupta, director research at CapitalVia Global Research.

telegram from hk


Telegram .NET Internals
FROM USA