Problem with implement the equiv of git pull
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.7k
- Forks
- 408
- Ø Merge
- 2 T. 57 Min.
- Gemergte PRs (30 T.)
- 7
Beschreibung
I am working my way through an implementation of git pull.
It seems that I need to do a Remote.fetch() call followed by a merge.
Problem (1): what is the robust way to generate the fetch_refspecs if the REmote.fetch_refspecs is empty? In other words do you have the APIs that I can duplciaste what push.default=simple causes git pull to do?
Problem (2): I have the objects fetched back I do not know the API to call to merge the remote changed into the local. I tried calling repo.merge() with the ID of the lastest commit from the remote.
But that only lead to modified files in the index. What is the correct API code to make this work?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie damit, die in der Issue erwähnten APIs Remote.fetch, Remote.fetch_refspecs und Repository.merge sowie die Verwendung von git pull mit push.default=simple zu lesen. Ermitteln Sie die unterstützte Fetch-und-Merge-Sequenz und bestätigen Sie anschließend, dass abgerufene Änderungen aus dem Remote-Repository in das lokale Repository gemergt werden, anstatt nur Änderungen am Index zu hinterlassen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, python
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100