I met Philipp Tempel (PhilTem) on the CodeIgniter Forum.
I was asking for help writing my series explaining the CodeIgniter source code.
Phil suggested a different workflow for blogging. One that’s conducive to collaboration.
This is all new to me. So baby steps it shall be!
Got GitHub (account)
EMAIL: my Yahoo! email
Installed a Git GUI client
GitHub.app (git client)
Allows gui interaction with Git (local); and sync to GitHub (remote).
Learned some Git
Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
This makes Git more like a mini filesystem …
.. it’s impossible to change the contents of any file or directory without Git knowing about it.
Git allows and encourages you to have multiple local branches that can be entirely independent of each other. …
… when you push to a remote repository, you do not have to push all of your branches. You can choose to share just one …
With Git, nearly all operations are performed locally …
.. Distributed SCM, .. This means that instead of doing a “checkout” of the current tip of the source code, you do a “clone” of the entire repository. … every user essentially has a full backup of the main server. …
.. centralized workflow .. Git will not allow you to push if someone has pushed since the last time you fetched …
I’ll be the only one to push to the ‘blessed’ repository (my repo on GITHUB); So, that won’t be a problem. However, if I pull (to my repo on GITHUB) from a contributor then I’ll need a fresh copy locally.
Integration Manager Workflow … involves an integration manager — a single person who commits to the ‘blessed’ repository. A number of developers then clone from that repository, push to their own independent repositories, and ask the integrator to pull in their changes. This is the type of development model often seen with open source or GitHub repositories.
Dictator and Lieutenants Workflow — For more massive projects … merge in all changes related to that subsystem. Another integrator (the ‘dictator’) can pull changes from only his/her lieutenants and then push to the ‘blessed’ repository that everyone then clones from again.
.. This means that if you have a commit ID, you can be assured not only that your project is exactly the same as when it was committed, …
.. Git has something called the “staging area” or “index”. This is an intermediate area where commits can be formatted and reviewed before completing the commit. … git add instead of git commit.
.. it’s possible to quickly stage some of your files and commit them without committing all of the other modified files in your working directory …
Installed Git (the git program)
Downloaded from: http://git-scm.com/download/mac
Mounted the disc image.
Ran the install. Which installed git to:
Restarted my computer.
I ran a shell script which came with download — sets up the Git
PATH for non-terminal programs.
Logged out of (then into) my computer account.
Saved the download to Dropbox.
Opened a shell and entered:
$ git config --global user.name "Sameh R. Labib" $ git config --global user.email "my Yahoo! email"
Git and GitHub emails match.
To tell git that I don’t want to type my username and password every time I talk to a remote server I had to install the
osxkeychain credential helper — and tell git to use it.
sameh-labibs-imac:~ samehlabib$ curl -s -O http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain sameh-labibs-imac:~ samehlabib$ chmod u+x git-credential-osxkeychain sameh-labibs-imac:~ samehlabib$ which git /usr/local/git/bin/git sameh-labibs-imac:~ samehlabib$ sudo mv git-credential-osxkeychain /usr/local/git/bin/ Password: sameh-labibs-imac:~ samehlabib$ git config --global credential.helper osxkeychain sameh-labibs-imac:~ samehlabib$
Manual says: The next time you clone an HTTPS URL that requires a password you will be prompted for your username and password, and to grant access to the OSX keychain. After you’ve done this, the username and password are stored in your keychain and you won’t be required to type them in to git again.
I assume that my git credentials are the same as for my
samehlabib computer account.
Created 1st GitHub Repository
This was accomplished by clicking the “Create a New Repo” button in my user bar’s right side.
I chose to have GitHub initialize the repo with a
README. This will allow me to
git clone the repository immediately.
Integration Manager Workflow is the git workflow I’ll use.
I’m the integration manager.
Sameh-R-Labib/CodeIgniter-3-Source-Explained on GitHub is the ‘blessed’ repo.
Changes, made by contributors, to the ‘blessed’ repo (master branch on GitHub) happen when I pull them.
Pull request workflow:
- Contributor asks me to pull
- I examen his branch (on GitHub) of my repo.
- (assume I approve)
- I pull his branch into the master (on GitHub)
- On my computer I’ll merge local branches with the master
Cloning to Local
I used Preferences in
GitHub.app to log into GitHub.
Now I have:
I did Clone to Computer (in GitHub.app) for my GITHUB repo branch.
The location for my local repo is now: