Ninja Space Content Tech Blog

Adding Existing Local Directory to a New GitHub Repo

December 30, 2020
This week seems like a GitHub week for me. Managing files, looking up terminal commands to get my files properly backed up and remembering it all are taking me hours this morning.

I've successfully cloned my old repo earlier today using my two-factor authentication and right now, I've just created another new repo to back up an older jQuery project that I had built months ago. I ran into a couple of issues getting my jQuery project onto GitHub but after some digging, I got it up there now. I didn't originally do a git init for this when I was working on this project because I hadn't learned it yet. Now that I've graduated from my coding bootcamp, I am going back and making sure I have these files on GitHub. Here were my steps below.

(It didn't ask me for a password or token this time like my clone project had asked me due to two-factor authentication so that's one less step I had to make for this one! You can read more about this two-factor authentication that I had to do.)

First, I created a new repository on GitHub on their website and then copied the file name by clicking on the green "Code" button. 
Then, I went into my local file where my jQuery project files are and cloned it with the following in the terminal:
git clone http://github.com(my New GitHub file name).git

Then, I needed to get this local directory to git so I did a git init command in the terminal with this:
git init

Then I tried to add all of my files to git by typing:
git add .
but it was giving all sorts of errors and by googling it, someone said they had to add the files one by one so I had to do that. For example:
git add app.js (hit enter)
git add index.html (hit enter)

and so forth. Then, when I typed git status those files showed up green now so by adding individual files one by one, it worked!

So then, I committed it with:
git commit -m 'my message'

And then typed git push and it provided me an upstream command that I copied and pasted and now my jQuery files are up on GitHub. Yay!

Github Repository Instructions Using Main Branch (2023 Update)

A lot of things has changed since I started coding bootcamp in June 2020 and today. Github no longer defaults to 'master' branch when you are push your files to your repository. I had to learn to make some adjustments and push my old notes away. First off, make sure you initialize before you can follow the steps from Github by entering git init in terminal. Then, you can add the below commands.

  • In the command line, I write: git remote add origin https://github.com/your-github-username/repo-name.git and after I do this, I created a new branch in VSC and named it 'main'.
  • After I am in my 'main' branch, I typed the following command: git branch -M main
  • Last, I type the following to commend to push my files to the GitHub repository: git push -u origin main

Starting my project with npm and react and installing packages

Since I use node with react, I always have to remind myself that I should initialize before installing packages. Remember to initialize with npm init and create your .gitignore file with node modules listed before installing packages. 

As of 2023, create-react-app is no more so I have to start learning Next.js.

 

Using Two Factor Authentication to clone my repository in Github

December 30, 2020
I had issues with cloning my repository today. It's related to my Two Factor Authentication that I enabled recently. For documentation purposes to help myself in the future and anyone else reading this, this is how I got it to work. Note that things in black bold are what I typed in my terminal and the things in sky blue are what the terminal responded with to make it easier to read through.

Before I started any terminal commands, I went into the GitHub site and created a new repository (I used the plus sign button) and then went onto my desktop and created a new folder name. Both of these are for my clone that I am about to explain in detail below. Here we go! (Sorry, too much Jamesify)

First, when I attempted to git clone https://github(my old GitHub repository).git in my terminal in the new folder I was in, I got this message immediately:
"remote: Invalid username or password."
"fatal: Authentication failed for 'https://github(my old GitHub repository).git'.


So, then I realized I needed to supply one of my tokens now (after you enabled two-factor authentication with GitHub, they supply you a list of tokens and you save them in a safe place to use) with my username and password. So I tried the following in my terminal:
git clone https://(my old GitHub repository) Username: tillyninjaspace Password: xxxxx-xxxxx 
(Note: I replaced my Password token with "x's" for security purposes.)

I got access now (YAY!) but then got returned the following:

fatal: Too many arguments.

usage: git clone [<options>] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don't use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recursive ...       alias of --recurse-submodules
    --recurse-submodules[=<pathspec>]
                          initialize submodules in the clone
    -j, --jobs <n>        number of submodules cloned in parallel
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --reference-if-able <repo>
                          reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of 'origin' to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --shallow-since <time>
                          create a shallow clone since a specific time
    --shallow-exclude <revision>
                          deepen history of shallow clone, excluding rev
    --single-branch       clone only one branch, HEAD or --branch
    --no-tags             don't clone any tags, and make later fetches not to follow them
    --shallow-submodules  any cloned submodules will be shallow
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository
    --server-option <server-specific>
                          option to transmit
    -4, --ipv4            use IPv4 addresses only
    -6, --ipv6            use IPv6 addresses only
    --filter <args>       object filtering


So I had to try something different and decided to do a ---bare clone first using this in my terminal: 
git clone --bare https://github.com(
my old GitHub repository).git

And it returned with these promising lines:
Cloning into bare repository '...'
remote: Enumerating objects: 32994, done.
remote: Total 32994 (delta 0), reused 0 (delta 0), pack-reused 32994
Receiving objects: 100% (32994/32994), 31.14 MiB | 16.66 MiB/s, done.
Resolving deltas: 100% (7710/7710), done.

Great! So now after I have successfully done a clone --bare, I tried to just do a straight up clone again with the following command: 
git clone https://github.com(my old GitHub repository).git

And it responded positively this time with the following lines: 
Cloning into '...'
remote: Enumerating objects: 32994, done.
remote: Total 32994 (delta 0), reused 0 (delta 0), pack-reused 32994
Receiving objects: 100% (32994/32994), 31.14 MiB | 16.66 MiB/s, done. 
Resolving deltas: 100% (7710/7710), done.

Now, I need to make sure I am at the very file I need to clone this old repository to. This step is very important. I typed 'ls' to see where I'm at and sure enough, I wasn't in the right folder in my terminal so I 'cd' into the folder that I needed to clone the old repository into. This is the new folder I created that I mentioned at the beginning of this post.
So, after I made sure I was in the right folder, I wrote the following command to include my new GitHub repository:
git remote set-url origin https://github(my NEW GitHub repository).git
I didn't see any messages returned to confirm anything but to not lose track of where I was at, I continued. I now have to push the files I had just cloned to my new Github repository so I did the following command:
git push

And the terminal did the following:
Enumerating objects: 32994, done.
Counting objects: 100% (32994/32994), done.
Delta compression using up to 8 threads
Compressing objects: 100% (23680/23680), done.
Writing objects: 100% (32994/32994), 31.14 MiB | 1.60 MiB/s, done.
Total 32994 (delta 7710), reused 32994 (delta 7710)
remote: Resolving deltas: 100% (7710/7710), done.
To https://github.com/tillyninjaspace/fitness_trackr_react.git
 * [new branch]        main -> main

I went to my new GitHub link on my browser and Voila! All my files are in my new repository now. My clone worked. I hope this will work for you as well. Also, I only had to use the password and token once to authenticate this whole process at the beginning. I don't know why I had to do the bare clone first. It doesn't make sense to me but I tried it and it worked for me. Maybe you can find a better way.
 

Updated to macOS Big Sur and enabled two-factor authentication for Github

December 29, 2020
Making sure all the tech, files, codes, branches and operating systems are up-to-date is a job in itself! I updated my operating system to Big Sur and am enabling my Github to two-factor authentication.

Today, is the first day I checked out my new macOS interface with Big Sur and I love it! Big Sur is located a couple hours from me and is such a beautiful place so I have such a good feeling about this operating system.

This morning, I also updated my settings in Github to enable two-factor authentication using sms messaging. It's mandatory to do that now because "Basic authentication using a password to Git is deprecated and will soon no longer work." I got that exact message in my email inbox from Github when I was trying to push my files to Github yesterday.

Another weird thing I'm having trouble with is when I am working with React, it works and runs fine until I push my files to Github, then it breaks. I know it has to do with the changes in package.json when I do that so right now I am just going to work in my files without pushing to Github, which sucks but I'll have to figure that one later.

Update: I figured out how to clone a repository using the new Two Factor Authentication via GitHub. Read more.
 

Nine days after Coding Bootcamp

December 28, 2020
I graduated from a 26-week online coding bootcamp about 9 nine days ago and I'm going through a lot of intense mixed emotions.

There is a great relief having to pass such an intense educational program and also a lot of fear. I have fear of not being 'good' enough yet to get a first job, fear of rejection after an interview and the anxiety of the thought of going into an interview. Emotionally and technically, I feel like I am ill-prepared. Therefore, I'm going to do some analyzation here.

What are the job titles that I am aiming for? 
Having had years of professional marketing experience in the past, before I started the coding bootcamp, I figured in order to secure a new marketing job nowadays, I'm going to need to code because there are so many hybrid positions now where the coders are also the marketers. However, after finishing halfway through this program, my thinking was I really needed to strengthen my knowledge as a coder because there is still so much to learn and I think that if I went for a hybrid marketing/coding position, my growth as a developer could hinder. So then, I just wanted to focus on coding and coding well. So towards the last month of my coding bootcamp cohort, I was very adamant to myself and my school's career advisor that I wanted a junior web developer or junior software engineering position. Now after graduating from the coding bootcamp program and looking at more job descriptions online, I'm not so sure if I'll make the cut as a junior developer. My 'reacto', algorithm and data structure knowledge is weak. I think I'll need to spend months studying all that before I can even feel confident enough for the next phone interview. So now, that is my game plan along with working on creating a new project for my portfolio. I started a new file for it but I'm currently having GitHub issues which I'll blog in another post. Basically it is related to this error: "Basic authentication using a password to Git is deprecated and will soon no longer work." Read how I figured out my GitHub Two Factor Authentication to resolve this.

I had one phone call and zoom interview for a developer job a few days after I graduated and this is how it went.
I got very lucky and one of the program's advisors forwarded my resume a few days after I graduated to one of the BIG 6 companies and to a gentleman who has his own contracting business for web development. Honestly, I had no idea my awesome advisor was going to move this fast after I graduated and the gentleman called me the next day after receiving my resume! I was ill-prepared mentally. I honestly wanted to take a break after spending so much of my time away from my family because of the bootcamp but I knew that I needed to return this call back because I had an inkling that this gentleman is well known in the developer's community where I live at and I figured if I bombed the interview, I would still be able to learn from this first interview.

Well, after an hour of mustering the will to call him back, we talked on the the phone and he told me a bit about the contracting position and asked if I had the time later that evening to do a Zoom interview so he could go more into detail about the project and share a bit of code. So then at 6PM that very evening, I jumped on a Zoom call with him and he told me about the pay, more about the client, his background and asked a couple of technical questions. I think I did okay on the technical questions except for one. He uses the MVC model to organize his code and I had no idea what he was talking about. My tech knowledge includes: express, pSQL react, node, jQuery and git for the last 6 months and evidently, I am still such a noob!

That really made me nervous. He also said our first deadline for some deliverables was going to be 3 weeks away and with the holidays and my kids being on winter break, I didn't think I was going to be able to meet his expectations. I was really honest about my low confidence on that. I think he appreciated my honestly and he also suggested that I work on my confidence in these interviews, which I know is going to be an ongoing problem until I have a few more solo projects post-school under my belt. All in all, even though my first interview wasn't a job success for me, I still felt like I learned so much from him. I wish I had the confidence to take the contracting job since it's especially important for my resume to get professional experience now but my gut just knew, I would suffer and I didn't want to falsely say that I'd want the job when I knew I wasn't the right person for it.

Well, now I'm also nervous if that other organization is going to call me, I will bomb my only chance! I need to get working on improving my chances, like right now! I'm reviewing my old lectures today and making back-ups of my bootcamp project files onto a thumb drive, which is taking a long time because I have so many files. I have to do an operating system update on my MacBook Pro but I wanted to back up my files before I did that because I was told that many developers had issues with working on stuff after the recent update. Now that I am done with coding bootcamp, I figured I don't have any thing due soon so there is no better time than now to face more challenges with developing right? 

What am I going to do now and when do I think I'll find my first developer job?
I am looking over algorithm problems online, trying to learn Redux which I am about halfway through an online tutorial that's over an hour long and working on my first personal project post-bootcamp. I have a lot to do. I'll write another blog post in the near future to tell you my progress. I'm hoping I'll have better promise on a job search in March; about three months from now. Wish me luck!

 

After Mac Update, I received a HPDriverCore.framework will damage your computer from HP Printer

October 31, 2020
I've owned this HP printer for several years now and today, I got this scary message when I tried to print something: "HPDriverCore.framework will damage your computer".

I thought maybe this was a one off thing so I proceeded but no matter what, this message prompt kept showing up. My HP drivers needed updating but it still had the old files so I had to figure out how to delete this printer from my computer list and completely delete the HP Printer Library files. I own a MAC computer and after googling this I've discovered that this is a problem that many HP printer owners are having! I'm not alone! After I googled how to do all of this, my printer started working again.

Basically, I had to remove the printer from my computer list, then find the HP files for this particular printer and deleted it. Then, when I was ready to use it again, the printer will prompt me to download drivers (new ones) so that it would work again. Lo and behold, I do not have to get a new printer! I'm able to print again.

2022 Update: Well, I probably shot myself in the foot when I updated my Mac to the Big Sur Update (the latest, currently) because now my scanner does not work at all so I attempted to try what I did a year before with the instructions above and now it won't work so I can't print or scan because HP does not have drivers for the Big Sur Mac update. Oh my goodness! So, guys if you did a Big Sur update this time, you won't be able to find the right drivers for the new Mac version if you have a HP Deskjet 1050 like I do.
 

About Ninja Space Content


Ninja Space Content I have been building simple websites on my own since 2008 and currently run several websites at the moment, including this one. I used to be an account manager for an affiliate/e-commerce company, helping affiliates grow their sales so I have some knowledge on the business side and client side of affiliate marketing. During the Covid-19 pandemic, I completed a JavaScript coding bootcamp and graduated in Dec 2020. I've been working as a contractor for a few software companies ever since.
Note: links to resources and promoting special deals may allow me to earn a small commission from each sale.