Up and Running with GitHub

Up and Running with GitHub

Over the past few weeks I have been debating on whether or not I should put the current project I am working on up on Github or not. I debated with the fact of should I wait until the project is somewhat “finished” or just go ahead and upload it now, while building it. I am still struggling with trying to decide how I want to handle it with future projects. However, I did go ahead and upload it to Github which was an adventure.

(I would love feedback thru the comments from any one who reads this on if you push on init or wait until the project is near completion)

Since the start of the project I have been committing to Git locally. I’m curious to know how others handle the situation. Do you push right after your init or wait until the project matures more? Mostly I want to upload to Github for portfolio purposes and just to show my projects I am building in case I need to link any one the code. On one hand I am not sure if it would be good to put up a project and show that I am working on it with continuous progress. Or wait until it is somewhat done with cleaner code to display at the end. What do you guys think?

# Uploading the project to Github

Yea.. that was a bit of a task. I was trying to push my project to Github using the command line and it just was not working. I have taken a class on GItHub from Codecademy. I watched a few training videos a while back on how to use Git on YouTube and all was great until I wanted to finally push. Out of all the tutorials I watched or completed NONE of them told me about this step. Apparently you have to first create the repo on the GitHub website and then push it to the remote repository. You could also use Github desktop.

Needless to say I jacked up my local repo (temporarily). Here is what I done to screw it up.

1. I went to GitHub to create the repository. Then I chose the option to init it with a license. Things just got worse from here.

2. I then tried to push it to the remote I just made but there was a conflict, according to my command line. The repo on the site was more up to date that what is locally on my Mac. Due to me creating it with a license. So I tried to pull it and that led to a host of other errors like the upstream tracking error, and fatal authentication errors and another error saying it doesn’t even exist!

3. Two factor authentication can cause errors on its own and that can be a headache.

What I done to remedy the issue was first I deleted the repo on GitHub. I also removed the association of the website repo from my local one. I used GitHub Desktop to do that. Once all that was done. I recreated the rep on the site(without the license). In case you aren’t familiar with how to create a repo on their website. Just click the + sign to the left of your profile picture in the top right corner. Then choose new repository. After you name it and create the repository. Then it will give you a series of steps based on your situation to get the project uploaded.

I am not sure why any of the tutorials I done personally could not simply say that instead of making it seem like it was all in the command line. I spent an hour trying to figure this out but lesson learned I guess.

# How to push to GitHub with Two Factor Authentication on

When you have the two factor on you will need to create a personal access token. You can access this by going to Settings. Then scroll to the bottom and under the developer settings choose the personal access tokens option. Be sure to keep record of the token you create in a safe place because it will only show you once. I typically use 1Password for things like this. Once that is taken care of you can push to GitHub without any authentication errors from the terminal. View the visuals below.

How to create a repo

How to push to GitHub

# API’s

When I first started working with API’s I did find it a bit intimidating just at first glance. A day or two later after learning how to construct a request and use the API documentation for a given task it has since been a breeze. It has opened up my project to a world of new features I didn’t even consider until I started to work with them.

Working with different API’s led me to look into further code organization. Also it helped me to realize when to create functions even better. the lines of code in my requests kept getting longer and longer with the more features I added. Then the light bulb came on and I started writing out more functions.

It just goes to show you, you definitely get better the more you code. Some things that may not make sense at first when you are learning the fundamentals will begin to make more since once you put things into practice and JavaScript has taught me that a lot.

# Gaining confidence

I began this project with a long list of features I wanted to implement. I honestly thought it was a bit ambitious but I at least wanted to give it a try. I purposefully made it very challenging with all new techniques and things I have not tried before. Whether it was working with API’s, implementing the time, manipulating the DOM, using REGEXPs, CSS animations, and just using pure JavaScript in general to make a project on my own. I look back at the progress I have made and I am amazed. A few months ago I wouldn’t have been able to do any of this at all! I am still going strong and I have not run into any major issues like I thought I would. I expected to get stuck on an issue for days at a time but that has not happened yet, though I am sure it will. I didn’t know how to do much of any of these things that were outside of HTML & CSS before I started. Now im flying through my long checklist of everything I want to do with 3 times the amount of confidence that I had coming in.

# Working on more than one project at once

I am now looking to start a 2nd project because sometimes I do get bored on working on just one. Having another one can help keep me engaged. Though I will not work on more than 2 projects at a time. I do not want to get in the habit of starting a bunch of projects and never finishing them. In the beginning I did not want to work on more than 1 to keep the focus and to help promote a more focused learning environment. Now that I am more comfortable with JS moving on to two is acceptable now.

# Using pure JS over libraries for learning

I am also glad I made the decision to use pure JS only instead of using jQuery. Yes, I know how to use jQuery but as I’ve said before. Libraries come and go, if you learn the fundamentals of any language you will be better off in the long run. The learning curve has definitely been steep. There were many times I just wanted to quickly hop over to jQuery and use it so I could move on. However, I stayed the course and I have learned so much from each issue I have run into and how to handle it in the future. To me that is very invaluable. It has slowed me down in the development process no doubt but i’ll take knowledge and understanding over fast and half baked builds where I am using a library and not really understanding the code behind it. Though there is nothing wrong with that if that is your thing but for me I rather know, than code blindly. Until next time, happy coding my friends.

-Dom

Leave a Reply

Your email address will not be published. Required fields are marked *