git remote -v show
এটি উত্স এ আসে কি ফিরে আসে?
যদি উত্সটি গিথুবকে নির্দেশ করে তবে স্ট্যাটাসটি আপ টু ডেট হওয়া উচিত এবং কোনও দূরবর্তী রেপোর চেয়ে এগিয়ে নয়। কমপক্ষে, গিট 1.6.5 দিয়ে আমি দ্রুত পরীক্ষার জন্য ব্যবহার করছি।
যাইহোক, এড়াতে, মাস্টার ব্রাঞ্চের দূরবর্তী রেপো স্পষ্টভাবে সংজ্ঞায়িত করুন:
$ git config branch.master.remote yourGitHubRepo.git
তারপরে ক git pull origin master
, এর পরে git status
একটি পরিষ্কার স্থিতি ফিরে আসবে (সামনে নেই)।
কেন? কারণ করুন উৎপত্তি মাস্টার (Git টান উৎপত্তি মাস্টার অন্তর্ভুক্ত) শুধু আপডেট করা হবে আনা FETCH_HEAD
(যেমন চার্লস বেইলি মধ্যে ব্যাখ্যা তার উত্তর ), কিন্তু এটা হবে এছাড়াও "দূরবর্তী মাস্টার শাখা" আপনার স্থানীয় গীত সংগ্রহস্থলের মধ্যে আপডেট করুন।
সেক্ষেত্রে আপনার স্থানীয় মাস্টার আর দূরবর্তী মাস্টারের চেয়ে "এগিয়ে" বলে মনে করবেন না।
আমি এটি git1.6.5 দিয়ে পরীক্ষা করতে পারি:
প্রথমে আমি একটি ওয়ার্কেরপো তৈরি করি:
PS D:\git\tests> cd pullahead
PS D:\git\tests\pullahead> git init workrepo
Initialized empty Git repository in D:/git/tests/pullahead/workrepo/.git/
PS D:\git\tests\pullahead> cd workrepo
PS D:\git\tests\pullahead\workrepo> echo firstContent > afile.txt
PS D:\git\tests\pullahead\workrepo> git add -A
PS D:\git\tests\pullahead\workrepo> git commit -m "first commit"
আমি একটি খালি রেপো তৈরি করে একটি গিটহাব রেপো অনুকরণ করি (যে কোনও জায়গা থেকে ধাক্কা পেতে পারে)
PS D:\git\tests\pullahead\workrepo> cd ..
PS D:\git\tests\pullahead> git clone --bare workrepo github
আমি আমার ওয়ার্কিং রেপোতে একটি মোডিফ যুক্ত করি, আমি গিথুব রেপোতে চাপ দিই (দূরবর্তী হিসাবে যুক্ত)
PS D:\git\tests\pullahead> cd workrepo
PS D:\git\tests\pullahead\workrepo> echo aModif >> afile.txt
PS D:\git\tests\pullahead\workrepo> git ci -a -m "a modif to send to github"
PS D:\git\tests\pullahead\workrepo> git remote add github d:/git/tests/pullahead/github
PS D:\git\tests\pullahead\workrepo> git push github
আমি একটি হোম রেপো তৈরি করেছি, গিটহাবের ক্লোন করেছি, যেখানে আমি গিটহাবের দিকে ধাক্কা দিয়ে বেশ কয়েকটি পরিবর্তন করেছি:
PS D:\git\tests\pullahead\workrepo> cd ..
PS D:\git\tests\pullahead> git clone github homerepo
PS D:\git\tests\pullahead> cd homerepo
PS D:\git\tests\pullahead\homerepo> type afile.txt
firstContent
aModif
PS D:\git\tests\pullahead\homerepo> echo aHomeModif1 >> afile.txt
PS D:\git\tests\pullahead\homerepo> git ci -a -m "a first home modif"
PS D:\git\tests\pullahead\homerepo> echo aHomeModif2 >> afile.txt
PS D:\git\tests\pullahead\homerepo> git ci -a -m "a second home modif"
PS D:\git\tests\pullahead\homerepo> git push github
আমি তখন প্রথম পরীক্ষার জন্য ওয়ার্কেরপো ক্লোন করেছি
PS D:\git\tests\pullahead\workrepo4> cd ..
PS D:\git\tests\pullahead> git clone workrepo workrepo2
Initialized empty Git repository in D:/git/tests/pullahead/workrepo2/.git/
PS D:\git\tests\pullahead> cd workrepo2
PS D:\git\tests\pullahead\workrepo2> git remote add github d:/git/tests/pullahead/github
PS D:\git\tests\pullahead\workrepo2> git pull github master
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From d:/git/tests/pullahead/github
* branch master -> FETCH_HEAD
Updating c2763f2..75ad279
Fast forward
afile.txt | Bin 46 -> 98 bytes
1 files changed, 0 insertions(+), 0 deletions(-)
সেই রেপোতে গিট স্ট্যাটাসে ' origin
' এর আগে মাস্টার জিইংয়ের কথা বলা হয়েছে:
PS D:\git\tests\pullahead\workrepo5> git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
nothing to commit (working directory clean)
তবে এটি কেবল origin
গিথুব নয়:
PS D:\git\tests\pullahead\workrepo2> git remote -v show
github d:/git/tests/pullahead/github (fetch)
github d:/git/tests/pullahead/github (push)
origin D:/git/tests/pullahead/workrepo (fetch)
origin D:/git/tests/pullahead/workrepo (push)
তবে আমি যদি কোনও রেপোতে ক্রমটির পুনরাবৃত্তি করি যার গিথুব (যার অর্থ কোনও উত্স নয়, কেবল একটি দূরবর্তী 'গিথুব' সংজ্ঞায়িত) থাকে তবে অবস্থান পরিষ্কার:
PS D:\git\tests\pullahead\workrepo2> cd ..
PS D:\git\tests\pullahead> git clone workrepo workrepo4
PS D:\git\tests\pullahead> cd workrepo4
PS D:\git\tests\pullahead\workrepo4> git remote rm origin
PS D:\git\tests\pullahead\workrepo4> git remote add github d:/git/tests/pullahead/github
PS D:\git\tests\pullahead\workrepo4> git pull github master
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From d:/git/tests/pullahead/github
* branch master -> FETCH_HEAD
Updating c2763f2..75ad279
Fast forward
afile.txt | Bin 46 -> 98 bytes
1 files changed, 0 insertions(+), 0 deletions(-)
PS D:\git\tests\pullahead\workrepo4> git status
# On branch master
nothing to commit (working directory clean)
যদি আমি শুধুমাত্র ছিল origin
উপর প্রতি নির্দেশ github
, status
git1.6.5 জন্য পরিষ্কার হবে।
এটি পূর্ববর্তী গিটের জন্য 'সামনের' সতর্কতার সাথে থাকতে পারে তবে যাইহোক, একটি git config branch.master.remote yourGitHubRepo.git
সংজ্ঞায়িতভাবে স্পষ্টভাবে গিটের প্রাথমিক সংস্করণগুলির সাথেও এটি যত্ন নিতে সক্ষম হওয়া উচিত।
git push
এটি সমাধানের জন্য (প্রতিবেদন "সব আপ টু ডেট") বলে মনে হবে।