[MacPorts] WorkingWithGit modified

MacPorts noreply at macports.org
Sat Aug 20 13:04:41 PDT 2016


Page "WorkingWithGit" was changed by cal at macports.org
Diff URL: <https://trac.macports.org/wiki/WorkingWithGit?action=diff&version=6>
Revision 6
Comment: Reformat so that the commands in whole-line blocks show the sequence you should be running for a commit.
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: WorkingWithGit
=========================================================================
--- WorkingWithGit (version: 5)
+++ WorkingWithGit (version: 6)
@@ -52,9 +52,26 @@
 See the [#reposplit section on repository splitting during the export] to get an overview of where a path in the old Subversion history is now available in Git.
 
 === Committing changes in your working copy ===
-A fundamental difference between Subversion and Git working copies is that `svn commit` by default commits all changes in your working copy, but `git commit` by default commits none. Git uses a staging area called "index" that allows you to mark changes for inclusion in the next commit. To add changes to the next commit, use `git add <filename>`. `git status` gives you an overview of the current index and your working copy. Additionally, it lists the commands to revert local uncommitted modifications (`git checkout -- <filename>`) and to remove files from the next commit, but preserve the modifications in your working copy (`git reset HEAD <filename>`).
+A fundamental difference between Subversion and Git working copies is that `svn commit` by default commits all changes in your working copy, but `git commit` by default commits none. Git uses a staging area called "index" that allows you to mark changes for inclusion in the next commit. To add changes to the next commit, use
+{{{
+git add <filename>...
+}}}
 
-Once you have chosen which files to include in your next commit using `git add`, it is a good practice to review this list using `git status` and show the diff to be committed using `git diff --cached`. When you are satisfied with your changes, run `git commit`, which prompts you for the commit message. See the [#commitmessages section on commit messages in git] for more information on git conventions and expectations in commit messages.
+`git status` gives you an overview of the current index and your working copy. Additionally, it lists the commands to revert local uncommitted modifications (`git checkout -- <filename>`) and to remove files from the next commit, but preserve the modifications in your working copy (`git reset HEAD <filename>`).
+
+Once you have chosen which files to include in your next commit using `git add`, it is a good practice to review this list using
+{{{
+git status
+}}}
+and show the diff to be committed using
+{{{
+git diff --cached
+}}}
+If you are not satisfied with your changes, you can keep changing your files. Note that you will have to add any new modifications to the index using `git add` again. Once you are satisfied with your change run
+{{{
+git commit
+}}}
+which prompts you for the commit message. See the [#commitmessages section on commit messages in git] for more information on git conventions and expectations in commit messages.
 
 
 == Common `git` tasks & notes about MacPorts' Subversion export ==
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/WorkingWithGit>
MacPorts <https://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'WorkingWithGit' page.
If it was not you, please report to .


More information about the macports-changes mailing list