.این وب سایت برای کمک به شما و درک برخی از مفاهیم اساسی گیت بصورت بصری طراحی شده ناست .این اولین تلاش من برای استفاده از هردو مورد اس وی جی و دی ثری است
اضافه کردن /سکوگذاری فایلهای شما برای کمیت کردن توسط این سایت پوشش داده نخواهد شد.بروی این سایت تمام درتمام محیط مجازی و انلاین کد نویسی بروی این سایت .فقط وانمود می کند که شما همیشه فایلهایی سکوگذاری شده و اماده کمیت کردن در همه زمانها دارید اگر شما در مورد چگونه اضافه یا سکوکردن فایلها برای کمیت کردن نیاز به یک یاداوری دارید لطفن بخوانید گیت بیسیک.
.محیط های مجازی به دستورات مشخصی تقسیم شده اند که درزیر لیست شده اند
ما نمیخواه یم به شما یاد بدهیم که چطوری فایل اضافه کنید ما فرض را بر این میگیریم که شما بلدین اگر بلد نیستید بروید سراغ آموزشگاه دیگر و فایل را مطالعه فرمایید در د جعب لل ه ترمینال به تعداد دفعاتی که دوست دارین .commit اضافه کنید
Pretend that you already have your files staged for commit and enter git commit as many times as you like in the terminal box.
git tag name will create a new tag named "name". Creating tags just creates a new tag pointing to the currently checked out commit.
Tags can be deleted using the command git tag -d name (coming soon).
Type git commit and git tag commands to your hearts desire until you understand this concept.
git branch name will create a new branch named "name". Creating branches just creates a new tag pointing to the currently checked out commit.
Branches can be deleted using the command git branch -d name.
Type git commit and git branch commands to your hearts desire until you understand this concept.
git checkout has many uses, but the main one is to switch between branches. For example, to switch from master branch to dev branch, I would type git checkout dev. After that, if I do a git commit, notice where it goes. Try it.
In addition to checking out branches, you can also checkout individual commits. Try it. Make a new commit and then type git checkout bb92e0e and see what happens.
Type git commit, git branch, and git checkout commands to your hearts desire until you understand this concept.
You can combine git branch and git checkout into a single command by typing git checkout -b branchname. This will create the branch if it does not already exist and immediately check it out.
git resetهد حرکت خواهد کرد و شاخه رو برمیگرداند به جایی که شما مشخص کردید، جدا از هر commit که ممکن است پشت سر بگذارید. این کار زمانی سودمند است که شما بخواهید commitرا که دیگر نیازی ندارید به حالت قبلی بازگردانید.
این دستور معمولا با یکی از سه فلگ Soft-Mixed,Hard استفاده می شود.فلگ هایSoft,Mixed با آنچه که درون commit بعد از ریست کردن بود سروکار دارد و شما میتونید درباره اون اینجا بخونید.. کلیک کنید. از آنجایی که این تصویر نمیتونه به صورت گرافیکی آن کار را نمایش دهد، فقط Flag هارد روی این سایت کار خواهد کرد.
کد "HEAD^" معمولا با این دستور با همدیگر کار می کنند. "HEAD^" به این معنی است: یک commit دقیقا قبل از هد. "HEAD^^" یعنی دو تغییر بعد از هد و به همین صورت.
دقت کنید که هرگز نباید دستور git reset را برای لغو تغییراتی که ثبت و یکپارچه با داده های اصلی شده اند استفاده کنید.این می تواند منجر به این شود که مخزن محلی شما با داده های اصلی ناهماهنگ شود.این کار را انجام ندهید مگر اینگه بدانید واقعا چه کاری می خواهید انجام دهید
To undo commits that have already been pushed and shared with the team, we cannot use the git reset command. Instead, we have to use git revert.
git revert will create a new commit that will undo all of the work that was done in the commit you want to revert.
git merge دستورگیت مرج ایجاد میکند یک کامیت به همراه دومرجع . نتایج کامیت ذخیره خواهد شد به صورت یک عکس که شامل تمام کارهایی است که بروی هر بخش انجام شده است اگرهیچ اختلافی بین دوکامیت وجود نداشته باشد گیت انجام خواهددادیک متد بازگشت سریع از حالت مرجع برای اینکه اتفاق افتادن این حالت را ببینیم برنچ راچک کرده و دستورگیت مرج دیو را اجرا میکنیم
If there was no divergence between the two commits, git will do a "fast-forward" method merge. To see this happen, checkout the 'ff' branch and then type git merge dev.
git rebase کامیت ها را در این انشعاب قرار میدهد آن ها را حرکت (جا به جا می کند) می دهد به طوری که پایگاه جدید آنها امکانیست که شما مشخص میکنید. شما باید به نحوه حرکت دایره ها . هنگامی که این تمرین را انجام میدهید توجه بسیار زیادی را به شناسه ها کامیت دایره ها بکنید . دلیل این که "حرکت یا جابه جایی" را درون کتیشن گذاشته ایم این است که این فرایند در واقع کامیت های کابل متفاوت با کامیت های جدید انشعاب تولید میکند به همین دلیل شما نمیخواهید که کامیت ها را با تیمی که با ان ها کار میکنید و تقسیم شده ریبیس کنید.
git fetch ".تمام انشعابات مسیر یابی را در مخزن محلی خود بروز رسانی خواهد کرد.که آن انشعابات را با برچسبی خاکستری رنگ مشخص می نماید."
A git pull is a two step process that first does a git fetch, and then does a git merge of the remote tracking branch associated with your current branch. If you have no current branch, the process will stop after fetching.
If the argument "--rebase" was given by typing git pull --rebase, the second step of pull process will be a rebase instead of a merge. This can be set to the default behavior by configuration by typing: git config branch.BRANCHNAME.rebase true.
A git push will find the commits you have on your local branch that the corresponding branch on the origin server does not have, and send them to the remote repository.
By default, all pushes must cause a fast-forward merge on the remote repository. If there is any divergence between your local branch and the remote branch, your push will be rejected. In this scenario, you need to pull first and then you will be able to push again.
One simple example of the use of git reset is to completely restore your local repository state to that of the origin. You can do so by typing git reset origin/master.
Note that this won't delete untracked files, you will have to delete those separately with the command git clean -df.
Below is a situation in which you are working in a local branch that is all your own. You want to receive the latest code from the origin server's master branch. To update your local branch, you can do it without having to switch branches!
First do a git fetch, then type git rebase origin/master!
git branch -d is used to delete branches. I have pre-created a bunch of branches for you to delete in the playground below. Have at it.
Do whatever you want in this free playground.
Below I have created some specific real-world scenarios that I feel are quite common and useful.