এই প্রশ্নটিতে অসংখ্যবার ফিরে আসার পরেও আমি সর্বদা এটির কোথাও আটকে যাই। আমি ধাপে ধাপে এটি করার একটি বিশদ প্রক্রিয়া নিয়ে হাজির হয়েছি:
প্রথমে কেবল git addআসল সামগ্রী যুক্ত করতে ব্যবহার করুন।
এটি সূচীতে যুক্ত হওয়া সম্পর্কিত ফাইলগুলি প্রদর্শন করবে যখন অন্য সমস্ত এখনও অবরুদ্ধ রয়েছে। এটি .gitignoreধাপে ধাপে চুক্তিতে সহায়তা করে ।
$ git add wp-content/themes/my-theme/*
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
Untracked files:
wp-admin/
wp-content/plugins/
wp-content/themes/twentyeleven/
wp-content/themes/twentytwelve/
...
wp-includes/
...
DUMMY.TXTআপনার ডিরেক্টরিতে একটি অস্থায়ী ফাইল যুক্ত করুন :
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
Untracked files:
wp-admin/
wp-content/plugins/
wp-content/themes/twentyeleven/
wp-content/themes/twentytwelve/
...
wp-content/themes/my-theme/DUMMY.TXT <<<
...
wp-includes/
...
আমাদের লক্ষ্য এখন নিয়মগুলি এমনভাবে তৈরি করা হয় যে এটি সম্পন্ন DUMMY.TXTহওয়ার পরে কেবল অবরুদ্ধ হিসাবে প্রদর্শিত হবে।
বিধি যুক্ত করা শুরু করুন:
.gitignore
/*
প্রথমটি হ'ল সব কিছু উপেক্ষা করা। আনট্রাক করা ফাইলগুলি সব শেষ হওয়া উচিত, কেবলমাত্র সূচিযুক্ত ফাইলগুলি প্রদর্শিত হবে:
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
পথে প্রথম দির যুক্ত করুন wp-content
/*
!/wp-content
এখন আনট্র্যাকড ফাইলগুলি আবার প্রদর্শিত হবে তবে কেবলমাত্র wp-contentএর লিখিত সামগ্রী রয়েছে
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
Untracked files:
wp-content/plugins/
wp-content/themes/twentyeleven/
wp-content/themes/twentytwelve/
..
প্রথম দির সমস্ত কিছু উপেক্ষা করুন /wp-content/*এবং উপেক্ষা করুন!/wp-content/themes
/*
!/wp-content
/wp-content/*
!/wp-content/themes
এখন আনট্র্যাকড ফাইলগুলি কেবল আরও নীচে সঙ্কুচিত হবে wp-content/themes
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
Untracked files:
wp-content/themes/twentyeleven/
wp-content/themes/twentytwelve/
..
প্রক্রিয়াটি পুনরাবৃত্তি করুন যতক্ষণ না সেই ডামি ফাইলটি কেবল অবরুদ্ধদের হিসাবে প্রদর্শিত হচ্ছে:
/*
!/wp-content
/wp-content/*
!/wp-content/themes
/wp-content/themes/*
!/wp-content/themes/my-theme
$ git status
Changes to be committed:
new file: wp-content/themes/my-theme/index.php
new file: wp-content/themes/my-theme/style.css
Untracked files:
wp-content/themes/my-theme/DUMMY.TXT
**ওয়াইল্ডকার্ড কেবলমাত্র ওয়ার্ডকার্ডগুলি যদি আপনার প্যাটার্নে কোনও স্ল্যাশ না থাকে তবে স্পিয়ারথটচ.ওয়ার্ডপ্রেস.কম