Skip to content

The book conflict with the git-remote man . #1173

Closed
@Splarv

Description

@Splarv

Cite from the book

«If the QA team wants to push their master branch to qa/master on the remote server, they can run

$ git push origin master:refs/heads/qa/master

If they want Git to do that automatically each time they run git push origin, they can add a push value to their config file:

[remote "origin"]
	url = https://github.com/schacon/simplegit-progit
	fetch = +refs/heads/*:refs/remotes/origin/*
	push = refs/heads/master:refs/heads/qa/master

Again, this will cause a git push origin to push the local master branch to the remote qa/master branch by default.»

Отрывок из книги: Scott Chacon. «Pro Git». Apple Books.

But here is cite from man git-remote:
Note that the push URL and the fetch URL, even though they can
set differently, must still refer to the same place. What you
pushed to the push URL should be what you would see if you
immediately fetched from the fetch URL. If you are trying to fe
from one place (e.g. your upstream) and push to another (e.g. y
publishing repository), use two separate remotes.

Obviously, that in the book case commit will be pushed to qa/master and not will be fetched by fetch = +refs/heads/*:refs/remotes/origin/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions