Gaining Fluency With Ruby’s Git Commands

Terri Lee NielsenGolden, Colorado

We’ve had an “edge-of-the-seat” intriguing first week of Davinci-Coder classes…!  While Building our Ruby Tool-belts, …… we are gaining fluency with Git Commands.

“Git” is a Version Control System (VCS), a tool used by coders around the world to keep track of their code and the changes they have made to it.

My past work experiences have been in Real Estate, Medical Sales, K-16 Education, and the Legal system.   So setting up an effective web environment is completely new to me.

Our instructor, Jason Noble, has us on the “edge of our seats,”…. while we review some basic elements that prepare us to dive into the Rails programming language.

It is easier to recall those “Value-Added Git Commands” when I consider their purpose.

Reasons to Master Git Commands:

  • Git Commands provide programmers the ability to keep track of their code and the changes they make to it.   Git Commands help ensure effective accountability of project changes…. or even changes under consideration — to see how they might effect what is built.
  • Git Commands help you prove or disprove that a particular line of code is breaking your project ( Karen Baker, 2013 ).

Gaining Fluency With Git Commands:

  • I like http://blogs.atlassian.com/2013/07/git-upstreams-forks/  Nicola Paolucci’s blogs on Git topics, and on using Git Commands.   Once you read one Paolucci blog, you will locate several others.  When I read his perspectives, I gain a better understanding of Best Practices surrounding Git Commands.

Here’s a sampling of Nicola Paolucci’s thoughts for July 22,  2013:  

Let me start by detailing a common setup;  and the most basic workflow to interact with upstream repositories.

In a standard setup you generally have an origin and an upstream remote – the latter being the gatekeeper of the project or the source of truth to which you wish to contribute to.

First, verify that you have already setup a remote for the upstream repository – and hopefully an origin too:

git remote -v

origin  git@bitbucket.org:my-user/some-project.git (fetch)

origin  git@bitbucket.org:my-user/some-project.git (push)

If you don’t have an upstream you can add it simply with the remote command:

git remote add upstream git@bitbucket.org:some-gatekeeper-maintainer/some-project.git

git remote -v

origin    git@bitbucket.org:my-user/some-project.git (fetch)

origin    git@bitbucket.org:my-user/some-project.git (push)

upstream  git@bitbucket.org:some-gatekeeper-maintainer/some-project.git (fetch)

upstream  git@bitbucket.org:some-gatekeeper-maintainer/some-project.git (push)

Now you can collect the latest changes of the upstream repository with fetch (repeat this every time you want to get updates):         git fetch upstream

If the project has tags that have not merged to master you should also do: git fetch upstream –tags

Again,….. entirety of Paolucci’s July 22, 2013 Git Blog is at :    

               http://blogs.atlassian.com/2013/07/git-upstreams-forks/

Thanks for stopping by to view some intriguing coverage of Ruby’s Git Commands.

Terri Lee Nielsen,   Golden, Colorado

Davinci Coders,   Boulder, Colorado

Advertisements
Posted in Git | Tagged | Leave a comment