Gitlab Push – Community Dev

- بررسی نسخه GIT
قبل از شروع با هرگونه عملیات GIT ، بررسی اینکه آیا GIT به درستی روی سیستم شما نصب شده است ، ضروری است. دستور زیر نسخه Git نصب شده را به شما نشان می دهد:
گیت -براندازی
- اولیه سازی یک مخزن GIT (GIT INIT)
برای شروع ردیابی یک پروژه با استفاده از GIT ، باید یک مخزن جدید GIT را در فهرست پروژه خود آغاز کنید. این کار را می توان با دستور git init انجام داد.
Navigating to your Project Directory: Before using Git, navigate to your project directory:
فرمان CD
Initialize Git Repository: Once you’re in the project directory, run the following command to initialize a Git repository:
git init
- پیکربندی گیت
پس از آن ، نام کاربری و ایمیل خود را پیکربندی کنید:
Git Config -global user.name “نام شما”
Git Config -global user.email “your.email@example.com”
- جعل و کلون کردن مخزن
Forking یک مخزن به معنای ایجاد نسخه ای از یک مخزن موجود در حساب GitHub شما است تا بتوانیم بدون تأثیرگذاری بر مخزن اصلی ، تغییراتی ایجاد کنیم.
چگونه یک مخزن را چنگ بزنیم
Go to the repository we want to contribute to on GitHub.
Click the Fork button at the top right.
Once forked, navigate to your GitHub profile and open the forked repository
Copy URL: Then a copy of real repository will be created in your local repository. After that, we have to copy the URL from your local repo. For doing that click to code and copy the URL.
- کلون کردن مخزن محلی
پس از چنگال ، مخزن را به دستگاه محلی خود کلون کنید
Create a folder on your desktop where you want to store the project files.
Open Git Bash and navigate to the newly created folder using the cd command:
سی دی
Copy the repository URL from GitHub.
In Git Bash, type the following command and press Enter
کلون گیت
The repository will be cloned into your desktop folder, making the project files available on your system.
- بررسی وضعیت
پس از ایجاد تغییر کد ، بررسی کنید که کدام پرونده ها با استفاده از آن اضافه نمی شوند:
وضعیت گیت
This command displays the current state of your working directory, indicating whether files are untracked, staged, or committed. Files in red are untracked or modified but not staged, while files in green are staged and ready to be committed.
- افزودن پرونده ها به منطقه مرحله بندی
وقتی می دانیم با تایپ وضعیت GIT کدام پرونده ها اضافه نمی شوند (پرونده های رنگ قرمز اضافه نمی شوند).
To track a file or prepare changes for commit:
git اضافه کردن
To add all changes:
git اضافه کنید.
-
مرتکب تغییرات
برای ذخیره تغییرات خود در مخزن محلی ، ابتدا وضعیت را با استفاده از:
وضعیت گیت
Files displayed in green are staged but not yet committed. To commit these changes, use:
Git Commit -m “پیام تعهد خود”
- فشار دادن تغییرات به GitHub
برای بارگذاری تعهدات در مخزن چنگال خود
منشأ فشار