dwyl / apprenticeship

🌱 Everything you need to know about the @dwyl Apprenticeship in Creative Technologies (ACT)
GNU General Public License v2.0
17 stars 1 forks source link

Take time to learn Git and how to use Github correctly #26

Open miguelmartins17 opened 4 years ago

miguelmartins17 commented 4 years ago

I took my day off today to learn Git and to use Github correctly. I had some doubts about how to add code or files to Github, how to perform a Git Push and how I can improve my performance when using Github. 💭 I've increasingly had the need to learn Git even putting other repositories as priorities to learn Git and how Github works can revolutionise my performance and save me a lot of time and headaches.

So I'm going to enjoy the day by starting to read: https://github.com/dwyl/start-here#git--github and leave everything I learn here.

miguelmartins17 commented 4 years ago

In just a few minutes I could understand that the basic steps about GitHub were already being used every day, how to create a repository, create a branch, edit an existing file, and how to create a request. 👍

It is not yet time to celebrate there are still many things about Git that I have to learn every day and day to improve. Screen Shot 2020-01-25 at 10 03 18

miguelmartins17 commented 4 years ago

I am currently reading and following the Git-it Guide the interactive workshop present in the repository:

https://github.com/dwyl/start-here#git--github

miguelmartins17 commented 4 years ago

I'm following the Git-it guide that's in the Start-here repository.

Screen Shot 2020-01-25 at 13 22 40

So far I am currently at step 5/11 and I intend to continue and see if I can finish these 11 steps today. I've already understood how I can use git to create new repositories and insert information there.

Screen Shot 2020-01-25 at 13 12 22

miguelmartins17 commented 4 years ago

I am now in step five of the creation of a remote repository. 5️⃣ I was able to create the repository ,and I'm doing it right now to create a repository that can help you with possible Flutter application ideas to be used in my day to day and in other people's day.

Screen Shot 2020-01-25 at 13 53 03

This is the repository I will use to express future ideas about Flutter applications.

Screen Shot 2020-01-25 at 13 49 29

Then I was able to connect the local to the remote. Using this command,

Screen Shot 2020-01-25 at 13 56 24

The next step would be to pass everything that was done locally to the Github using the command,

Screen Shot 2020-01-25 at 14 00 19

When I ran that command on the command line, the following error appears.

Screen Shot 2020-01-25 at 14 01 31

Screen Shot 2020-01-25 at 14 02 28

So I tried to run the git push --set-upstream origin master command and I continue with the same error.

Screen Shot 2020-01-25 at 14 02 28

nelsonic commented 4 years ago

@miguelmartins17 run the following command:

git remote -v
miguelmartins17 commented 4 years ago

@nelsonic This is the result.

Screen Shot 2020-01-25 at 14 11 57

nelsonic commented 4 years ago

@miguelmartins17 looks like you have it setup correctly. Are you able to make a change on GitHub and git pull it to your localhost?

miguelmartins17 commented 4 years ago

@nelsonic I've been researching and found out what the cause of the error was, so the cause of the error is due to the repository still being empty. There are no commits in the repository.

Resolution

Create the first commit inside of the repository and then it can be pushed.

`touch initial

git add initial

git commit -m "initial commit"

git push -u origin master`

miguelmartins17 commented 4 years ago

By using this git push -u origin master command I was able to already insert the code into the repository I created. I needed to enter my Github username and password to change data.

Screen Shot 2020-01-25 at 15 10 38

Here is what changed we send our branch named 'master' to our remote on GitHub named 'origin'.

Screen Shot 2020-01-25 at 15 11 01

miguelmartins17 commented 4 years ago

If you enter the repository now it is no longer empty, a file with "initial commit" will appear that will be changed but that means that with those commands it works.

Screen Shot 2020-01-25 at 15 17 25

miguelmartins17 commented 4 years ago

I finished the Git-it workshop today and learned some basic things about how Git and Github work.

Screen Shot 2020-01-26 at 17 53 13

I intend to continue watching and following the Tutorials present in the Start-here repository. The tutorial I'll start now is the learn-git-basics in order to deepen my knowledge.

Screen Shot 2020-01-26 at 17 53 44

miguelmartins17 commented 4 years ago

I'm getting to the Committing part and I'm trying to finish this tutorial today. 👍

Screen Shot 2020-01-27 at 14 32 53 Screen Shot 2020-01-27 at 14 33 12