When you use Git to manage your code changes, you create a
directory on your local computer for each branch that you
wish to work with. This is in addition to the set files that
exist at github.com.
- When you execute the git commands from the command line
in the shell, you should have the current directory set
to the root of the file system on your laptop.
- When you use an IDE such as Eclipse, you should not have the
local files within the directory structure that the IDE uses by
default. You will then specify the directory containing in the
files within the IDE.
Once you have made changes to the files, the following procedure
will move the changes to the copy at github.com.
- Set the current directory to the root of the file system for the
branch.
- The command
git add .
will insure that all of the files
are marked for management.
- The command
git commit -a -m "my comments"
will
locate all of the modified files and mark them as committed. The text
after the -m
operator will become the message Git
uses to describe the commit.
- To move all of the changes to the copy on github.com, you will
execute the command
git push origin branch
where branch is the name of the branch to be processed.
On my system, the branches are master for the project
and gh-pages for the documentation.
To create the documentation for the GitHub site, you need to do the following.
- Clone a copy of your GitHub project at a new location on your workstation.
- Set the current directory to the root folder of this new clone.
- Use the git command to change the branch to gh-pages with the orphan setting.
- Delete all of the files in the gh-pages branch.
- Insert the files that make up your documentation site.
- Mark all of the files as being tracked by git.
- Commit the set of files.
- Push the gh-pages branch back to the project on GitHub.