2012-03-15 5 views
6

गिट पर प्रलेखन के अनुसार, git pull वर्तमान शाखा का एक फ़ेच करेगा और फिर परिवर्तनों को मर्ज करने के लिए git merge चलाएगा। एक सहयोगी के बाद सर्वर में अपने बदलाव किए और धक्का दिया, मैं उन्हें पुनः प्राप्त करने के लिए चला गया।क्यों 'गिट पुल' चल रहा है मेरे प्रतिबद्ध परिवर्तनों को हटा दें?

git add src 
git add war 

git status पुष्टि की है कि अपने परिवर्तनों को प्रतिबद्ध होना करने का मंचन किया गया चल रहा है:

पहले, मैं बदलाव है कि मैं था प्रतिबद्ध है। इसके बाद, मैं भाग गया:

git commit -m "Another commit to work on scrolling" 

बाद में, मैं परिवर्तन नीचे खींच लिया: - या बल्कि कोशिश की

remote: Counting objects: 31, done. 
remote: Compressing objects: 100% (16/16), done. 
remote: Total 16 (delta 13), reused 3 (delta 0) 
Unpacking objects: 100% (16/16), done. 
From github.com:FullCreative/Loop 
+ 3f00b3f...2e09a49 master  -> master (forced update) 
Warning: fetch updated the current branch head. 
Warning: fast-forwarding your working tree from 
Warning: commit 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c. 
Already up-to-date. 

अन्त में, मैं अपने परिवर्तनों को धक्का दिया:

git pull 

यह मैं कुछ चेतावनियों से पता चला उन्हें धक्का देने के लिए - सर्वर पर:

git push 

प्रश्न:

अब, यह मेरे सभी परिवर्तनों को क्यों हटा दिया? यहां तक ​​कि फाइलें जो मेरे सहयोगी ने मेरी कार्य निर्देशिका से को संशोधित नहीं किया था।

कंसोल आउटपुट:

पूर्णता के लिए, नीचे मेरी टर्मिनल से सांत्वना लॉग है। यह आदेशों मैं भाग गया, और उन आदेशों से उत्पादन पता चलता है:

[email protected]:~$ cd git 
[email protected]:~/git$ l 
Loop/ Loop-1-18.tar.gz 
[email protected]:~/git$ cd Loop 
[email protected]:~/git/Loop$ l 
Loop/ README readme.textile 
[email protected]:~/git/Loop$ l 
Loop/ README readme.textile 
[email protected]:~/git/Loop$ cd Loop 
[email protected]:~/git/Loop/Loop$ l 
src/ war/ 
[email protected]:~/git/Loop/Loop$ git add src 
[email protected]:~/git/Loop/Loop$ git status 
# On branch master 
# Changes to be committed: 
# (use "git reset HEAD <file>..." to unstage) 
# 
# modified: src/com/fullcreative/loop/Globals.java 
# modified: src/com/fullcreative/loop/LoopController.java 
# modified: src/com/fullcreative/loop/LoopDao.java 
# modified: src/com/fullcreative/loop/LoopDaoJdo.java 
# modified: src/com/fullcreative/loop/LoopService.java 
# new file: src/com/fullcreative/loop/TestLoopController.java 
# 
# Changes not staged for commit: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: war/WEB-INF/LoopDispatcher-servlet.xml 
# modified: war/WEB-INF/appengine-web.xml 
# modified: war/WEB-INF/applicationContext-security.xml 
# modified: war/WEB-INF/html/index.html 
# modified: war/WEB-INF/web.xml 
# modified: war/js/loop.js 
# 
# Untracked files: 
# (use "git add <file>..." to include in what will be committed) 
# 
# war/WEB-INF/admin/local-storage.html 
[email protected]:~/git/Loop/Loop$ git add war 
[email protected]:~/git/Loop/Loop$ git status 
# On branch master 
# Changes to be committed: 
# (use "git reset HEAD <file>..." to unstage) 
# 
# modified: src/com/fullcreative/loop/Globals.java 
# modified: src/com/fullcreative/loop/LoopController.java 
# modified: src/com/fullcreative/loop/LoopDao.java 
# modified: src/com/fullcreative/loop/LoopDaoJdo.java 
# modified: src/com/fullcreative/loop/LoopService.java 
# new file: src/com/fullcreative/loop/TestLoopController.java 
# modified: war/WEB-INF/LoopDispatcher-servlet.xml 
# new file: war/WEB-INF/admin/local-storage.html 
# modified: war/WEB-INF/appengine-web.xml 
# modified: war/WEB-INF/applicationContext-security.xml 
# modified: war/WEB-INF/html/index.html 
# modified: war/WEB-INF/web.xml 
# modified: war/js/loop.js 
# 
[email protected]:~/git/Loop/Loop$ git commit -m "Another commit to work on scolling" 
[master 3f00b3f] Another commit to work on scolling 
13 files changed, 726 insertions(+), 218 deletions(-) 
create mode 100644 Loop/src/com/fullcreative/loop/TestLoopController.java 
create mode 100644 Loop/war/WEB-INF/admin/local-storage.html 
[email protected]:~/git/Loop/Loop$ git pull 
remote: Counting objects: 31, done. 
remote: Compressing objects: 100% (16/16), done. 
remote: Total 16 (delta 13), reused 3 (delta 0) 
Unpacking objects: 100% (16/16), done. 
From github.com:FullCreative/Loop 
+ 3f00b3f...2e09a49 master  -> master (forced update) 
Warning: fetch updated the current branch head. 
Warning: fast-forwarding your working tree from 
Warning: commit 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c. 
Already up-to-date. 
[email protected]:~/git/Loop/Loop$ git push 
Everything up-to-date 
[email protected]:~/git/Loop/Loop$ git status 
# On branch master 
nothing to commit (working directory clean) 
[email protected]:~/git/Loop/Loop$ git history 
git: 'history' is not a git command. See 'git --help'. 
[email protected]:~/git/Loop/Loop$ git --help 
usage: git [--version] [--exec-path[=<path>]] [--html-path] 
     [-p|--paginate|--no-pager] [--no-replace-objects] 
     [--bare] [--git-dir=<path>] [--work-tree=<path>] 
     [-c name=value] [--help] 
     <command> [<args>] 

The most commonly used git commands are: 
    add  Add file contents to the index 
    bisect  Find by binary search the change that introduced a bug 
    branch  List, create, or delete branches 
    checkout Checkout a branch or paths to the working tree 
    clone  Clone a repository into a new directory 
    commit  Record changes to the repository 
    diff  Show changes between commits, commit and working tree, etc 
    fetch  Download objects and refs from another repository 
    grep  Print lines matching a pattern 
    init  Create an empty git repository or reinitialize an existing one 
    log  Show commit logs 
    merge  Join two or more development histories together 
    mv   Move or rename a file, a directory, or a symlink 
    pull  Fetch from and merge with another repository or a local branch 
    push  Update remote refs along with associated objects 
    rebase  Forward-port local commits to the updated upstream head 
    reset  Reset current HEAD to the specified state 
    rm   Remove files from the working tree and from the index 
    show  Show various types of objects 
    status  Show the working tree status 
    tag  Create, list, delete or verify a tag object signed with GPG 

See 'git help <command>' for more information on a specific command. 
[email protected]:~/git/Loop/Loop$ git log 
commit 2e09a498829e2b12e4bbdff8f8c39c2ce47dacb7 
Author: Josh Iwata < [email protected]> 
Date: Thu Mar 15 14:25:28 2012 -0700 

    Design revamp 

commit 2927f853041dab06a48861498adc945d6969865a 
Author: James Mortensen <[email protected]> 
Date: Wed Mar 14 09:25:46 2012 -0700 

    Removed Alert. 

commit 07deceb9cb3cda6b913b2bde96970682ecdbddb7 
Author: James Mortensen <[email protected]> 
Date: Wed Mar 14 09:04:12 2012 -0700 

    Added url pattern to the servlet to get rid of the error. 

commit f2d48bb735e5c3f1d3cb88ad80483e5596aaa063 
Author: James Mortensen <[email protected]> 
Date: Tue Mar 13 15:44:28 2012 -0700 

    iJames took over again! 

commit 88fb39c0b37b2dfc5a13e30f212cba525e33f531 
Author: David Raffauf <[email protected]> 
Date: Tue Mar 13 15:42:26 2012 -0700 

    I test update 

commit 5b1af15d166fc766a1a892a13865d9c5be506a6f 
Author: Josh Iwata < [email protected]> 
[email protected]:~/git/Loop/Loop$ git status 
# On branch master 
nothing to commit (working directory clean) 
[email protected]:~/git/Loop/Loop$ git pull 
Already up-to-date. 
[email protected]:~/git/Loop/Loop$ l 
src/ war/ 
[email protected]:~/git/Loop/Loop$ cd src 
[email protected]:~/git/Loop/Loop/src$ l 
cacerts.bin com/ log4j.properties META-INF/ 
[email protected]:~/git/Loop/Loop/src$ cd com 
[email protected]:~/git/Loop/Loop/src/com$ l 
fullcreative/ 
[email protected]:~/git/Loop/Loop/src/com$ cd fullcreative/loop/ 
[email protected]:~/git/Loop/Loop/src/com/fullcreative/loop$ l 
AbstractBaseController.java Comment.java     LoopController.java  PusheableResponse.java 
AccountController.java  EmailService.java    LoopDao.java   samples/ 
Account.java     EnvironmentService.java   LoopDaoJdo.java   security/ 
AccountService.java   FormManagerController.java  Loop.java    Settings.java 
AuthenticatorController.java Globals.java     LoopService.java  TagSubscription.java 
AuthenticatorService.java  GoogleCometChannelService.java LoopServlet.java  UserDao.java 
Cacheable.java    HttpRequestHandler.java   Memcached.java   UserDaoJdo.java 
Card.java      InvitationDetailsDaoJdo.java OAuth2User.java   User.java 
CardManagerController.java InvitationDetails.java   OAuth2UserService.java 
CardTemplateService.java  JSONPResponse.java    PMF.java 
[email protected]:~/git/Loop/Loop/src/com/fullcreative/loop$ cd/
[email protected]:/$ cd 
[email protected]:~$ cd workspace 
[email protected]:~/workspace$ l 
ActiveResponseWebService/   ConversionChromeApp.pem  GAE Spring Security/  LoopSVN/ 
Adaptiv3ChatDemo/     ConversionChromeExtension/ GAE Spring Security Demo/ Loop.tar.gz 
Adaptiv3ChatDemo-2.zip    ConversionSupportChromeApp/ gdata-samples-read-only/ ReverseProxyDemo/ 
Adaptiv3ChatDemo.zip    ConversionSupportLive/  LexLegal/     rhino-for-webapps-demo/ 
AmazonC3Demo/      ConversionSupportLiveNew/ LexMatter/     SB4.0/ 
App-AnswerConnect/     ConversionSupportLiveNew2/ local_db.bin    SB4.0_branch/ 
appengine-java-sdk-1.6.2.1/  ConversionSupportLive.zip Loop/      sokolove_lawfirm/ 
appengine-java-sdk-1.6.2.1.zip  Conversion Support- Mobile/ Loop2/      test/ 
appengine-java-sdk-1.6.3.1/  ConversionSupportWebsite/ Loop-Oauth2-Demo/   Test/ 
appengine-java-sdk-1.6.3.1.zip  ConverstionSupportMobileV1/ LoopRepo/     Thinclient-c3/ 
AppointmentSchedulingAppGAEJ/  ConverstionSupportMobileV2/ LoopRepo-1-12-2-.tar.gz Thinclient-c3.zip 
ChatClientWebservices/    datastore-indexes-auto.xml LoopRepo1-12.tar.gz 
ContactManagementSystemDataStore/ EchopassChatClient/   LoopRepo1-13.tar.gz 
ConversionChromeApp0.1.1109.6.crx FullTextSearchService/  LoopRepo.tar.gz 
[email protected]:~/workspace$ cd Loop 
[email protected]:~/workspace/Loop$ l 
Loop/ README readme.textile 
[email protected]:~/workspace/Loop$ cd Loop 
[email protected]:~/workspace/Loop/Loop$ l 
src/ war/ 
[email protected]:~/workspace/Loop/Loop$ cd src 
[email protected]:~/workspace/Loop/Loop/src$ l 
cacerts.bin com/ log4j.properties META-INF/ 
[email protected]:~/workspace/Loop/Loop/src$ cd com 
[email protected]:~/workspace/Loop/Loop/src/com$ l 
fullcreative/ 
[email protected]:~/workspace/Loop/Loop/src/com$ cd fullcreative/ 
[email protected]:~/workspace/Loop/Loop/src/com/fullcreative$ l 
loop/ 
[email protected]:~/workspace/Loop/Loop/src/com/fullcreative$ cd loop 
[email protected]:~/workspace/Loop/Loop/src/com/fullcreative/loop$ 
[email protected]:~/workspace/Loop/Loop/src/com/fullcreative/loop$ l 
AccountController.java  Card.java      LoopController.java Memcached.java   UserDao.java 
Account.java     Comment.java     LoopDao.java   OAuth2User.java   UserDaoJdo.java 
AccountService.java   EnvironmentService.java  LoopDaoJdo.java  OAuth2UserService.java User.java 
AuthenticatorController.java HttpRequestHandler.java  Loop.java   PMF.java 
AuthenticatorService.java  InvitationDetailsDaoJdo.java LoopService.java  samples/ 
Cacheable.java    InvitationDetails.java  LoopServlet.java  security/ 
[email protected]:~/workspace/Loop/Loop/src/com/fullcreative/loop$ cd ../../../../ 
[email protected]:~/workspace/Loop/Loop$ cd ../../.. 
[email protected]:~$ cd git 
[email protected]:~/git$ l 
Loop/ Loop-1-18.tar.gz 
[email protected]:~/git$ cd Loop 
[email protected]:~/git/Loop$ l 
Loop/ README readme.textile 
[email protected]:~/git/Loop$ cd Loop 
[email protected]:~/git/Loop/Loop$ l 
src/ war/ 
[email protected]:~/git/Loop/Loop$ 

अद्यतन:

मैं हैश से बाहर की जाँच के आधार पर अपना प्रतिबद्ध पहुँच सकते हैं:

git checkout 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c 

तो सर्वर में मेरे धक्का में क्यों शामिल नहीं हैं?

अद्यतन # git reflog की 2

परिणाम:

3f00b3f [email protected]{0}: checkout: moving from master to 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c 
2e09a49 [email protected]{1}: checkout: moving from 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c to master 
3f00b3f [email protected]{2}: checkout: moving from master to 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c 
2e09a49 [email protected]{3}: pull : forced-update 
3f00b3f [email protected]{4}: commit: Another commit to work on scolling 
2927f85 [email protected]{5}: commit: Removed Alert. 
07deceb [email protected]{6}: commit: Added url pattern to the servlet to get rid of the error. 
f2d48bb [email protected]{7}: commit: iJames took over again! 
88fb39c [email protected]{8}: pull : fast-forward 
a22893e [email protected]{9}: commit: Committing a very important change to intro.css. Not! 
ac19755 [email protected]{10}: pull : fast-forward 
d2a401d [email protected]{11}: commit: This is a test 
85a6328 [email protected]{12}: commit: Modified gitignore yet again. 
251f557 [email protected]{13}: commit: Committing the classpath. Hope it works. 
4e7a428 [email protected]{14}: checkout: moving from local_master to master 
97aa2d7 [email protected]{15}: checkout: moving from master to local_master 
4e7a428 [email protected]{16}: commit: Added Admin panel for making system changes. Modified the title and description so they go into edit 
38dc2fa [email protected]{17}: commit: Added notifications and real time comet. 
bc2f950 [email protected]{18}: commit: Real time updates and chrome notifications. 
bc2f950 [email protected]{19}: commit: Adding TagSubscription class. 
5e696f4 [email protected]{20}: commit: Bulk delete, fixed delete bug, tagging features and subscriptions. Added more server-side caching. Ad 
7b41cc2 [email protected]{21}: commit: adding dropdown plugin files 
d9e3716 [email protected]{22}: commit: Added filter list to top, made dynamic, and deployed to 2-20. 
e256d21 [email protected]{23}: commit: Cleaned up the HTML code. 
d9e3716 [email protected]{24}: commit: Third time is a charm. 
3e0863f [email protected]{25}: commit: Here is the 2nd commit for tag-it. 
13e70c8 [email protected]{26}: commit: Added the tag-it tags to the application and connected to the database. 
0893615 [email protected]{27}: commit: Deployed 2-7 and made default version. 
0073e04 [email protected]{28}: commit: Deployed to 2-7 and made the default version. Finalized mobile form, although the error class shadow 
0073e04 [email protected]{29}: commit: test 
4351a93 [email protected]{30}: commit: Added notifications for comments and cleaned up mobile form. 
5674cfb [email protected]{31}: commit: Added Developer API call to switch users for @loopround.com users. 
a22808f [email protected]{32}: commit: updating 
8fa1a39 [email protected]{33}: commit: updating the repository 
8fa1a39 [email protected]{34}: commit: Deployed to http://0-9-2012-1-27.loopaback.appspot.com/ 
4786be1 [email protected]{35}: commit: Updating the inbox counts on each loop on page load. Also changed the style of the inbox count on the 
33bf8d5 [email protected]{36}: commit: Adding elastic JS library. 
095d8e6 [email protected]{37}: commit: Hooked up inbox counts and colors on the loops. 
d3275ef [email protected]{38}: commit: committing. 
a66024c [email protected]{39}: commit: Put in place email notifications for sharing. Put in place more logging statements to catch errors. F 
a66024c [email protected]{40}: commit: Fixed sharing settings and cleaned up some of the code. Fixed the invitation system and also added so 
e87ca75 [email protected]{41}: commit: Fixed sharing settings and cleaned up some of the code. Fixed the invitation system and also added so 
e87ca75 [email protected]{42}: commit: Got rid of login form and also integrated Loop feedback form. 
b2d7da9 [email protected]{43}: commit: Eliminated the login page and also integrated the Feedback Loop Form. 
b2d7da9 [email protected]{44}: commit: Added the Loop Form. 
e7ea0eb [email protected]{45}: commit: Added the Loop Form to the Loop Application and connected it to the services. 
e7ea0eb [email protected]{46}: commit: Trying to get all the files for the settings page in the repo. 
97aa2d7 [email protected]{47}: commit: test 
36d4841 [email protected]{48}: commit: Got the settings page in place so users can be added and removed. 
cf83cbd [email protected]{49}: commit: Committing this file because I want it to accept changes, not have the repository just simply force m 
e7ccb2d [email protected]{50}: commit: Merged Josh's changes, I hope! 
90ee5a5 [email protected]{51}: commit: Merged Josh's changes. Why I have to do this manually, I don't know? 
3fc14b4 [email protected]{52}: commit: Service giving ability to send email to a user. 
2ce4a6c [email protected]{53}: commit: Worked on the UI for adding a user to a Loop. Also fixed the display so it shows all active users ass 
21caa9b [email protected]{54}: commit: Updated the application-manifest.xml file with the new LoopRound name and latest version info. 
4330694 [email protected]{55}: commit: Deployed to http://0-9-2012-1-12-1715.loopaback.appspot.com/# and made the default version. Added in 
adde3cd [email protected]{56}: commit: Can now add new loops from the Loop screen. To rename the loop or access it's settings page; currentl 
6902710 [email protected]{57}: commit: Settings page is functional to edit the loop name. 
6980c79 [email protected]{58}: merge branch 'master' of [email protected]:FullCreative/Loop.git: Fast-forward 
e364173 [email protected]{59}: commit: Added Josh's CSS to style.css. 2nd attempt. 
0e464f1 [email protected]{60}: 

.git/कॉन्फ़िग फ़ाइल

[core] 
    repositoryformatversion = 0 
    filemode = true 
    logallrefupdates = true 
    autocrlf = false 
[remote "origin"] 
    url = [email protected]:FullCreative/Loop.git 
    fetch = +refs/heads/*:refs/heads/* 
    push = refs/heads/*:refs/heads/* 
[branch "master"] 
    remote = origin 
    merge = refs/heads/master 
+0

'गिट रीफ्लॉग' क्या कहता है? –

+0

'घातक: एक गिट भंडार (या मूल निर्देशिका में से कोई भी नहीं): .git'। मैं वर्तमान में उस हैश का उपयोग करके चेक आउट कर रहा हूं ... – jmort253

+0

या 'गीटक' क्या दिखाता है? – CanSpice

उत्तर

6

मुझे लगता है कि समस्या की कुंजी आपके पुल कमांड पर अशुभ संदेश में है: देखें कि यह कहां "मजबूर अद्यतन" कहता है? यह गिट का आपको थोड़ा बताने का तरीका है कि शाखा (मास्टर) को फिर से बनाया गया है या पुन: विश्राम किया गया है, एक साझा भंडार पर एक बड़ा नंबर नहीं है।

यदि आप पुन: मास्टर या पुन: निर्मित मास्टर हैं तो आपको अन्य सहयोगियों से पूछना चाहिए। यदि आप जो हुआ उसके बारे में एक चित्रमय दृश्य चाहते हैं, तो gitk --all आज़माएं।

आपकी समस्या का समाधान करने के लिए शायद कोई शानदार तरीका नहीं है, लेकिन आसान काम करने के लिए चेरी-पिक है जो एक मास्टर (git cherry-pick 3f00b3f) पर प्रतिबद्ध है और फिर धक्का देता है।

+0

प्रतिक्रिया के लिए धन्यवाद। हमें संदेह था कि "मजबूर अद्यतन" जगह से बाहर था, 'गिट पुल' पर विचार करने के लिए कुछ भी ओवरराइट नहीं किया जाना चाहिए ... हम इसमें देखेंगे। धन्यवाद! – jmort253

+1

मुझे विश्वास नहीं है कि यह एक रिस्टेड अपस्ट्रीम के कारण है। अगर अपस्ट्रीम शाखा को रिबेस किया गया है तो आपको मजबूर अपडेट मिलेगा, जो आपकी स्थानीय मास्टर शाखा में कोई भी बदलाव नहीं खोना चाहिए। और यदि आप बारीकी से देखते हैं, तो मजबूर अद्यतन 'मास्टर -> मास्टर' था, न कि 'मास्टर -> मूल/मास्टर', जो उचित रिमोट ट्रैकिंग शाखा के लिए होना चाहिए। मुझे विश्वास है कि मुझे क्या विश्वास है इसके विवरण के लिए मेरा उत्तर देखें। –

+0

+1 - चेरी पिक कमांड मदद की! मैं सर्वर पर वापस धक्का देने में सक्षम था। अगला कदम: मुझे यह पता लगाने की ज़रूरत है कि मास्टर के रिबेस या मनोरंजन के कारण क्या हुआ। – jmort253

8

निम्नलिखित लाइनों संदिग्ध लग रही:

From github.com:FullCreative/Loop 
+ 3f00b3f...2e09a49 master  -> master (forced update) 
Warning: fetch updated the current branch head. 
Warning: fast-forwarding your working tree from 
Warning: commit 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c. 

विशेष रूप से, अगर आप सही तरीके से कॉन्फ़िगर कर रहे हैं, लाइन master -> origin/master का संकेत देना चाहिए, या जो कुछ भी अपने रिमोट का नाम है। इसके बजाय, यह master -> master पढ़ता है। यह इंगित करता है कि रिमोट पर master शाखा सीधे आपके स्थानीय रेपो में master शाखा में लिखी जा रही है; जिसका अर्थ है कि आप अपनी प्रतिबद्धता का संदर्भ खो देते हैं (हालांकि आपने देखा है, यह अभी भी आपके रेपो में है, इसे किसी भी चीज़ द्वारा संदर्भित नहीं किया गया है)। यही कारण है कि गिट मुद्रित "चेतावनी: वर्तमान शाखा प्रमुख को अद्यतन किया।"

अपने .git/config देखें। यह कुछ इस तरह होना चाहिए:

[remote "origin"] 
     url = <some url> 
     fetch = +refs/heads/*:refs/heads/* 

यह Git कि जब लेते समय यह दूरदराज के मूल्य लिखना चाहिए बताता है:

[remote "origin"] 
     url = <some url> 
     fetch = +refs/heads/*:refs/remotes/origin/* 

हालांकि, त्रुटि आप मिल गया के आधार पर, यह शायद कुछ ऐसा होता है सीधे अपनी स्थानीय शाखा में शाखा। आम तौर पर, उपरोक्त सही कॉन्फ़िगरेशन में, जब आप रिमोट रेफरी प्राप्त करते हैं, तो यह refs/remotes/<remote>/<name> पर लिखा जाता है। यह आपको अपस्ट्रीम प्रतिबद्धता और आपके स्थानीय प्रतिबद्धता दोनों का ट्रैक रखने की अनुमति देता है, ताकि आप उन्हें विलय कर सकें। गलत कॉन्फ़िगरेशन में, आप बस अपने स्थानीय रेफरी को ओवरराइट कर रहे हैं, जो मूल रूप से आपके पास था उसका ट्रैक खोना।

मुझे यकीन नहीं है कि आप इस तरह से कैसे स्थापित हुए हैं; शायद आपने git clone --mirror या git remote add --mirror=fetch जैसे कुछ किया था। भले ही, आप अपने .git/config फ़ाइल को मैन्युअल रूप से संपादित कर सकते हैं, और ऊपर बताए अनुसार fetch लाइन को सही कर सकते हैं।

+0

मैंने प्रश्न में कॉन्फ़िगरेशन फ़ाइल जोड़ दी। आप इसमें क्या शामिल हैं इसके बारे में बिल्कुल सही हैं। अच्छा अंदाजा! '' 'के बाद लाने को' refs/head/* 'पर सेट किया जाता है। कल, हम मूल जोड़ने और कुछ और परीक्षण करने की कोशिश करेंगे। तुम्हारी सहायता सराहनीय है! – jmort253

2

इसे ठीक करने के प्रकार:

git checkout master; git merge 3f00b3f6cb6ed6beddb16baa92f1beaa82b6944c 

फिर झटका, जिन्होंने git push --force

+0

कोई भी 'गिट पुश --force' नहीं चला। चूंकि हम में से तीन हमारी कंपनी में सीवीएस प्रतिस्थापन के रूप में अग्रणी हैं, इसलिए हम इसे एक साथ सीख रहे हैं और जब हम में से प्रत्येक धक्का देता है या काम करता है तब मौजूद होता है। मैंने '--force' का उपयोग करके हम में से कोई भी नहीं देखा है, और इसका उपयोग इस उदाहरण में नहीं किया गया था। – jmort253

+0

* केवल * रास्ता जहां तक ​​मुझे "मजबूर अद्यतन" प्राप्त करने के बारे में पता है, अगर कोई पुश-फोर्स चलाता है। –

0

भाग गया एक ही बात मुझे क्या हुआ और इस पोस्ट Git एक्सटेंशन और Git पार्टी का उपयोग कर एक समाधान करने के लिए मुझे नेतृत्व काउंटर जाना।

चूंकि मैं गिट एक्सटेंशन का उपयोग कर रहा था, मेरे पास इतिहास के इतिहास को देखने के लिए कंसोल विंडो नहीं थी। इसके अलावा, मुझे कोई चेतावनी नहीं मिली और मैं शायद ही कभी गिट बैश का उपयोग करता हूं इसलिए मैं इससे परिचित नहीं हूं।

मुझे [प्रोजेक्ट पथ] \। Git \ logs \ HEAD में देखकर प्रतिबद्ध आईडी मिली। यह वहां जानकारी का आखिरी बिट था:

commit: ################ 
d511e44dca8c3f7f6f8d3985f3ca54874fb67a63 673fd2fbfc5ad78434389c64565904f81aa9a5ad unknown <###.(none)> 1444281107 -0500 pull --progress I:/####/#####+refs/heads/master:refs/heads/master: forced-update 

मैंने मैन्युअल रूप से मजबूर अद्यतन नहीं किया। मैं एक बाहरी ड्राइव से खींच/धक्का देने की कोशिश कर रहा था और आखिरी बार मैंने ऐसा करने के बाद पत्र बदल दिया था, इसलिए मैं याद रखने की कोशिश कर रहा था कि मैंने इसे पहली बार कैसे स्थापित किया और मैंने कुछ गलत किया। यह रिमोट फ़ील्ड के बजाय यूआरएल फ़ील्ड का उपयोग करने से संबंधित हो सकता है।

इसे ठीक करने के लिए मैं Git बैश में इस प्रयोग किया है:

git checkout 673fd2fbfc5ad78434389c64565904f81aa9a5ad 

जो एक शाखा के बिना VS2010 में कोड भरी हुई। फिर मैंने कोड के लिए एक नई शाखा बनाने के लिए गिट एक्सटेंशन का उपयोग किया, मास्टर पर वापस स्विच किया और नई शाखा को वापस मास्टर में विलय कर दिया। यह

git checkout master; git merge 673fd2fbfc5ad78434389c64565904f81aa9a5ad 

तो यह बहुत ही समान समाधान है क्योंकि सिवाय इसके कि मुझे प्रतिबद्ध आईडी को एक अलग तरीके से ढूंढना पड़ा।

संबंधित मुद्दे