Skip to contentSkip to conversation

documentation: update the "Pushing changes to a public repository" section

PATCH In review Elia Pinto 2 participants 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore

Elia Pinto

author
#0 lore raw

PATCH 1/1 documentation: update the "Pushing changes to a public repository" section

Extracted from git v1.7.0 Release Notes:

* "git push" into a branch that is currently checked out (i.e. pointed at by HEAD in a repository that is not bare) is refused by default.

Update the user manual where necessary

---
 Documentation/user-manual.txt |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Documentation/user-manual.txt +0 -0
index fe6fb72..0897839 100644
@@ -1963,10 +1963,14 @@ As with `git fetch`, `git push` will complain

if this does not result in a
handling this case.

Note that the target of a "push" is normally a
-<<def_bare_repository,bare>> repository. You can also push to a -repository that has a checked-out working tree, but the working tree -will not be updated by the push. This may lead to unexpected results if -the branch you push to is the currently checked-out branch! +<<def_bare_repository,bare>> repository. Until the version 1.7 you could +also push to a repository that has a checked-out working tree, +but the working tree will not be updated by the push. This might lead to +unexpected results if the branch you pushed to was the currently checked-out +branch! From 1.7.0 git push" into a branch that is currently checked out
+(i.e. pointed at by HEAD in a repository that is not bare)
+is refused by default.
+

As with git fetch, you may also set up configuration options to save typing; so, for example, after
--
1.6.6

#1 lore raw
Quoted 6 lines · Elia Pinto

Extracted from git v1.7.0 Release Notes:

* "git push" into a branch that is currently checked out (i.e. pointed at by HEAD in a repository that is not bare) is refused by default.

Update the user manual where necessary

It is a good change. I have some comments below, but I prefer when the docs explain first the current behavior and afterwards, as a note or alike, the prior behavior. Like this?

-repository that has a checked-out working tree, but the working tree -will not be updated by the push. This may lead to unexpected results if -the branch you push to is the currently checked-out branch! +repository that has a checked-out working tree, but not into a branch that is +currently checked out (i.e. pointed at by HEAD in a repository that is not +bare), as it is refused by default. This is not allowed by default because +this may lead to unexpected results. Note that prior to the version 1.7 it was +allowed.

Quoted 14 lines

---
 Documentation/user-manual.txt |   12 ++++++++----

 1 files changed, 8 insertions(+), 4 deletions(-)
Documentation/user-manual.txt +0 -0
index fe6fb72..0897839 100644
@@ -1963,10 +1963,14 @@ As with `git fetch`, `git push` will complain

if this does not result in a
 handling this case.

 Note that the target of a "push" is normally a -<<def_bare_repository,bare>> repository.  You can also push to a

Documentation/user-manual.txt

Quoted 4 lines
Documentation/user-manual.txt +1 -3
-repository that has a checked-out working tree, but the working tree
-will not be updated by the push.  This may lead to unexpected results if
-the branch you push to is the currently checked-out branch!
+<<def_bare_repository,bare>> repository.  Until the version 1.7 you could

This implies that in 1.7 you can.

Documentation/user-manual.txt

Quoted 4 lines
Documentation/user-manual.txt +4 -0
+also push to a repository that has a checked-out working tree,
+but the working tree will not be updated by the push.  This might lead to
+unexpected results if the branch you pushed to was the currently checked-out
+branch! From 1.7.0 git push" into a branch that is currently checked out

Missing ".

Documentation/user-manual.txt

Quoted 3 lines
Documentation/user-manual.txt +3 -0
+(i.e. pointed at by   HEAD in a repository that is not bare)
+is refused by default.
+

Thanks,
Santi