22 Aralık 2022 Perşembe

git diff seçeneği - Show Changes Not Yet Staged

Giriş
Açıklaması şöyle
Show Changes Not Yet Staged
Örnek
Açıklaması şöyle
If you face a situation where you need to share some changes in the code base that you have made with your co-worker but you cannot yet push your changes to the remote repository, you can use the patch command of git. Here is how it works:

After you have made all the changes you can run the following command:

git diff > filename.patch

git diff > filename.patch will create a file that will contain all uncommitted the changes you have made so far in the code base. Then you can simple share this file with your coworker via slack,email,USB etc .

You coworker will simply download you patch file and run the following command:

git apply filename.patch

This would apply all the code changes you have made in the code base on your coworker’s copy of the code.

Örnek
branch ve master arasındaki farkı görmek için şöyle yaparız.
git diff featureXYZ_branch master
Örnek
Şöyle yaparız.
git diff remotes/origin/featureXYZ_branch remotes/origin/master

Hiç yorum yok:

Yorum Gönder