-
Notifications
You must be signed in to change notification settings - Fork 8
04. Committing changes
Commit changes once you are sure that you are done making changes to a particular feature and have done some basic testing on your local development environment.
Keep in mind that it makes sense to group related changes into separate commits. For example, if you've made several changes to the text of system-sent emails in dspace/config/emails, it makes sense to group them all into the same commit. In general, each GitHub issue should 1) have its own branch, and 2) have its own single commit.
For every commit, please write at least a succinct subject line in the imperative, tied to particular issues when possible (e.g., "Fix bug #34 regarding excessive line breaks in abstract field display"). Most commits should also have a message body describing in more detail the nature of the code changes and their effect on the front end of the software. For more instructions on good commit practices, read this post (http://chris.beams.io/posts/git-commit/)[http://chris.beams.io/posts/git-commit/]
If your commit is a good candidate for contribution to the DSpace core project (i.e., it's a bug in the overall system we fixed and we want others who use DSpace to benefit from the fix), you can use "git tag dspacecore" to tag your commit.
To commit your changes, once tests on your local development environment were successful, go to the directory vtlibans_dspace/dspace on your local host and issue some or all of the following commands:
git status
git diff (filename)
git add (filename)
git commit -m "(Write your commit message here)" // one-line message
OR
git commit // opens the text editor to write a multi-line message
- git status [Shows information about changes to your local repository]
- git diff (filename) [lets you compare the current version of a file with the previous version]
- git add --all [Adds all changes you've made to a staging queue; you can also add only selected changes by adding the name of the changed file, e.g., 'git add (filename)']
- git status [This will let you see what is about to be committed]
- git commit -m "Write your commit message here" [Records all your staged changes locally and adds an explanatory message about what your changes are for]
See Pro Git for more help with git.