본문 바로가기

Git

Performing first commit

<Basic Cycles we are gonna be following>

1. Make changes


2. Add the changes

$ git add .

// tell git the changes everything you made (. : this directory)


3. Commit changes to the repository with a message

$ git commit -m "Initial commit"

//commit! put it in your repository


** Writing commit messages

- message tells us what is in the set

- short single-line summary (less than 50 chars)

- optionally followed by a blank line and a more complete description(when there are a lot of changes)

- keep each line to less than 72 chars

- Write commit messages in present tense, not past tense (fix bug or fixes but)

- bullet points are usually asterisks or hyphens

- can add "ticket tracking numbers" from bugs or support requests

- can develop shorthand for your organization ex: "[css,js]", "bugfix: ", "#38405 - "

(to everyone to agree to it)

- Be clear and descriptive (bad: "Fix typo" / Good: "Add missing > in project section of HTML"

(bad: "Update login code" / Good: "Change user authentication to use Blowfish")

(bad: "Updates member report, we should discuss if this is right next week" /  Good: provide good message)


Example:

t23094 - Fixes bug in admin logout

When an admin logged out of the admin area, they could not log in to the members area because their session[:user_id] was still set to the admin ID. This patch fixes the bug by setting session[:user_id] to nil when any user logs out of any area.


==> It describes what the problem was and what the solution was well, so with this message, we don't actually look at the code.

'Git' 카테고리의 다른 글

Undoing Changes  (0) 2017.06.18
How to view the commit log  (0) 2017.06.11
Initializing a repository  (0) 2017.06.11
Installing Git  (0) 2017.06.11
About Distributed Version Control  (0) 2017.06.11