Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: cleanup of text/formatting in Git Lifecycle section

...

Bearing in mind that you will always being doing your work and commits locally, a typical session looks like this:

git clone git@github.com:DSpace/DSpace.git && cd dspace
Get a copy of the central storage facility (the repository).

git branch DS-123
Create a local branch called "DS-123".

...

  • Wiki Markup
    Get a copy of the central storage facility (the repository). This is how you download a copy of the DSpace Source Code (i.e. {{\[dspace-source\]}}), but this source code directory also is a valid local git repository. In the below example, we've called this directory "dspace-src", but you can call it whatever you want.
    Code Block
    git clone git@github.com:DSpace/DSpace.git dspace-src
    cd dspace-src
  • Create a local branch called "DS-123". This is what is traditionally called a "topic" or "feature" branch in Git. You are creating a branch to work on a specific topic or feature (in this case a ticket named "DS-123").
    Code Block
    git branch DS-123
  • Create a local copy of the branch from master (if it doesn't exist

...

  • ) and make it your active working branch. You are now developing on the DS-123 branch.
    Code Block
    git checkout DS-123
  • Now, start creating, editing files, testing. When you're ready to commit your changes:

    ...

    Code Block
    git add 

...

  • [file

...

  • ]

...

  • This

...

  • tells

...

  • git

...

  • that

...

  • the

...

  • file(s)

...

  • should

...

  • be

...

  • added

...

  • to

...

  • the

...

  • next

...

  • commit.

...

  • You'll

...

  • need

...

  • to

...

  • do

...

  • this

...

  • on

...

  • files

...

  • you

...

  • modify,

...

  • also.

...

  • Commit your changes locally. This only modifies your local copy of the repository, and the commits only happen in your local "DS-123" branch.
    Code Block
    git commit 

...

  • [file

...

  • ]

...

  • Now, the magic:
    Code Block
    git push origin DS-123
    This command pushes the current state of your local repository, including all commits, up to github ("origin" repository). Your work becomes part of the history of the public "DS-123" branch on github.

git push is the command that changes the state of the remote code branch. Nothing you do locally will have any affect outside your workstation until you push your changes.

...