-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few cleanups #163
A few cleanups #163
Conversation
The name of the subsytem is considered to be 'Git' and not 'git'. There was inconsistency in the document by referring to the subsystem using both 'git' and 'Git'. Consolidate the usages to 'Git' which is generally considered to be the name of the subsystem.
They website is generally called 'GitHub' and not 'github'.
This is done for the sake of consistency. Most of the section names don't have a fullstop at the end. So, ...
The Table of Contents seems to have been out of date with the section titles. So, update the ToC with 'doctoc'.
The example for that exhibits the way to 'prune' remote branches that were deleted upstream wasn't flexible as it relied on the command defaulting to the upstream of the current branch. This might lead the reader into overlooking the flexibility of the `git fetch`. Show that the 'upstream' can be mentioned in the command thus show casing the flexibility of `git fetch`.
It's not good for newbies to start using 'force deletion' when they want to delete a branch as it might lead them to them into 'accidentally' deleting their branches often without merging them into other branches or pushing them to an upstream. So, exemplify the safer version of branch deletion (branch -d) and warn them about what `git branch -D` does.
It's not required to use 'git' a lot as this a document about Git, after all.
Rebasing fast-forwards when the tip of the branch is a descendent of the tip of the upstream. In other cases it re-writes the history. This re-write is what actually leads the user to 'force' update the remote. So, clarify that a user has to force update only when the history is re-written regardless of whether the branch was fast-forwarded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good. Did you manually change all of the TOC links? They're supposed to refer to the link anchor tags, although I can't recall exactly why we went for anchor tags instead of just using Markdown.
|
||
```sh | ||
$ git fetch -p | ||
$ git fetch -p upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a note saying to check that upstream is the remote you want to fetch from.
README.md
Outdated
(master)$ git branch -d my-branch | ||
``` | ||
|
||
To delete a local branch that HAS NOT been merged to the current branch or an upstream: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for all caps for HAS NOT
README.md
Outdated
@@ -729,7 +735,7 @@ $ git push -u origin HEAD | |||
|
|||
If you want to check out the other default configs which ```git push``` can take, visit the documentation for Git at https://git-scm.com/docs/git-config#git-config-pushdefault | |||
|
|||
If you do not want to change the git configuration, you can also use: | |||
If you do not want to change the configuration, you can also use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps "the global configuration for Git" would be more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it gives the wrong view. We didn't use the --global
option in the previous command. So, we can't say "global configuration". Why do you think "... to change the configuration... " isn;t clear enough?
Regardless, reading the context a little I guess it's confusing readers a lot by using inconsistent terms. I'll try to fix the confusion in a commit. Let's see how it goes.
Capitalizing words seems to be over emphasizing words. Italicize the words, instead to see if works.
@RichardLitt Thanks for the detailed review.
Nope. I used |
The commands were needlessly complex by not considering the fact that the command defaults to HEAD when no branch is specified and changing configuration when it wasn't required. Simplify the commands to make readers more happy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close! Getting there!
README.md
Outdated
``` | ||
|
||
where, `upstream` is the e remote you want to fetch from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivaraam No need to comment - just amend the commit or add a new one and my comment will go away. :)
README.md
Outdated
``` | ||
|
||
With the ```upstream``` mode and the ```simple``` mode (default in Git 2.0), the following command will push the current branch w.r.t. the remote branch that has been registered previously with -u : | ||
With the `upstream` mode and the `simple` (default in Git 2.0) mode of the `push.default` config, the following command will push the current branch w.r.t. the remote branch that has been registered previously with -u : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here, change w.r.t. to 'with regards to', and put ticks around -u
, and move the colon next to it?
I like the changes. Please make the requested changed by @RichardLitt |
This is an instance of a carelessly edited document getting into version control. ;)
... by, - expanding acronyms - quoting a command line parameter
Thank you! |
These commands had been inserted in k88hudson#148 and (over)simplified in k88hudson#163. The issue is that `git push <remote>` & `git push -u <remote` will typically raise the error below (unlike `git push <remote> HEAD`): --8<---------------cut here---------------start------------->8--- fatal: The current branch new-branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin new-branch --8<---------------cut here---------------end--------------->8---
These commands had been inserted in k88hudson#148 and (over)simplified in k88hudson#163. The issue is that `git push <remote>` and `git push -u <remote>` will typically raise the error below (unlike `git push <remote> HEAD`): --8<---------------cut here---------------start------------->8--- fatal: The current branch new-branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin new-branch --8<---------------cut here---------------end--------------->8---
#208) * Add missing HEAD argument in 2 Git commands These commands had been inserted in #148 and (over)simplified in #163. The issue is that `git push <remote>` and `git push -u <remote>` will typically raise the error below (unlike `git push <remote> HEAD`): --8<---------------cut here---------------start------------->8--- fatal: The current branch new-branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin new-branch --8<---------------cut here---------------end--------------->8--- * Add doc URL & Avoid triple backquotes
* Consolidate the name of the subsystem The name of the subsytem is considered to be 'Git' and not 'git'. There was inconsistency in the document by referring to the subsystem using both 'git' and 'Git'. Consolidate the usages to 'Git' which is generally considered to be the name of the subsystem. * Consolidate the name of GitHub They website is generally called 'GitHub' and not 'github'. * Quote the git commands correctly * Avoid fullstops in section names This is done for the sake of consistency. Most of the section names don't have a fullstop at the end. So, ... * Update the ToC The Table of Contents seems to have been out of date with the section titles. So, update the ToC with 'doctoc'. * Clarify that the changes are removed only for the previous commit * Showcase the flexibility of `git fetch -p` The example for that exhibits the way to 'prune' remote branches that were deleted upstream wasn't flexible as it relied on the command defaulting to the upstream of the current branch. This might lead the reader into overlooking the flexibility of the `git fetch`. Show that the 'upstream' can be mentioned in the command thus show casing the flexibility of `git fetch`. * Exemplify the safer version of branch deletion It's not good for newbies to start using 'force deletion' when they want to delete a branch as it might lead them to them into 'accidentally' deleting their branches often without merging them into other branches or pushing them to an upstream. So, exemplify the safer version of branch deletion (branch -d) and warn them about what `git branch -D` does. * Improve readability of a few phrases It's not required to use 'git' a lot as this a document about Git, after all. * Use HTTPS links for sites that serve using HTTPS * Clarify that rebasing just re-writes history Rebasing fast-forwards when the tip of the branch is a descendent of the tip of the upstream. In other cases it re-writes the history. This re-write is what actually leads the user to 'force' update the remote. So, clarify that a user has to force update only when the history is re-written regardless of whether the branch was fast-forwarded. * Attribute both the authors of the second edition of Pro Git * Try a different form of emphasizing text Capitalizing words seems to be over emphasizing words. Italicize the words, instead to see if works. * Mention what 'upstream' means for the sake of clarity * Simplify the way to create a remote branch from the local one The commands were needlessly complex by not considering the fact that the command defaults to HEAD when no branch is specified and changing configuration when it wasn't required. Simplify the commands to make readers more happy! * Remove a character cruft left over while editing This is an instance of a carelessly edited document getting into version control. ;) * Improve a sentence ... by, - expanding acronyms - quoting a command line parameter
k88hudson#208) * Add missing HEAD argument in 2 Git commands These commands had been inserted in k88hudson#148 and (over)simplified in k88hudson#163. The issue is that `git push <remote>` and `git push -u <remote>` will typically raise the error below (unlike `git push <remote> HEAD`): --8<---------------cut here---------------start------------->8--- fatal: The current branch new-branch has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin new-branch --8<---------------cut here---------------end--------------->8--- * Add doc URL & Avoid triple backquotes
These commits add a few cleanups that I saw when skimming through the document. A few might be obvious improvements and a few might be needless churns. Let me know about which ones are good/bad so that I could change them accordingly. Hope this helps.