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

Push code for Github #33

Open miguelmartins17 opened 4 years ago

miguelmartins17 commented 4 years ago

How can I push the code of an entire application? Do I need to push file to file or folder to folder or can I do it all right?

nelsonic commented 4 years ago

@miguelmartins17 good question. if you are in the root of the project simply run git add . (the . means "add everything in this directory and all sub-directories). e.g:

cd learn-flutter
git add .
git commit -m 'add complete code for TDD & Architecture Video 9 for issue #15'
miguelmartins17 commented 4 years ago

After executing these commands this was the result.

Screen Shot 2020-03-02 at 10 12 23

nelsonic commented 4 years ago

@miguelmartins17 that's strange. 😕 Did you add the project files to the learn-flutter/tdd-architecture-example directory? 💭 If you want to show us your desktop via Zoom call, just message in Signal/@dwyl 💻

iteles commented 4 years ago

It might also help to run the git status command and git log to get a fuller picture.

miguelmartins17 commented 4 years ago

This is the result when I run the git log command.

Screen Shot 2020-03-02 at 16 51 48

nelsonic commented 4 years ago

@miguelmartins17 after our Zoom call do you feel more confident in your git skills?

miguelmartins17 commented 4 years ago

@nelsonic I tried to push the code to the GitHub but when I run the git push command this shows up.

Screen Shot 2020-03-09 at 10 54 29

nelsonic commented 4 years ago

@miguelmartins17 what did Google say when you pasted the error message and searched? 💭

nelsonic commented 4 years ago

The solution is right there in the yellow text. You need to run git pull before git push because there are changes on GitHub that are not reflected on your localhost ...

miguelmartins17 commented 4 years ago

@nelsonic I tried to look for answers like using git pull but this only comes to me when I run the command.

Screen Shot 2020-03-09 at 22 02 47

nelsonic commented 4 years ago

@miguelmartins17 which branch do you want to be working on? (maybe it's time that you give your branches more descriptive names) 💭

miguelmartins17 commented 4 years ago

The branch miguelmartins17-patch-4 didn't show up at the terminal so I created it. Of course I should give the branches a better name.

miguelmartins17 commented 4 years ago

@nelsonic I think I'm forgetting some steps so I can put the project in the GitHub.

nelsonic commented 4 years ago

@miguelmartins17 agreed. Please revisit the Git guide: https://git-scm.com/book/en/v2 The better you know Git the faster you can get your work done. We all take Git skills for granted much like we do with arithmetic, but it's worth knowing well.

miguelmartins17 commented 4 years ago

I ran the git push command and this appears.

Screen Shot 2020-03-12 at 13 09 46

So I tried to run the command using the way they describe it there: git push --set-upstream origin miguelmartins17-patch-4.

Screen Shot 2020-03-12 at 13 09 57

After that I thought about using git pull, and I got this result.

Screen Shot 2020-03-09 at 22 02 47

nelsonic commented 4 years ago

@miguelmartins17 did you run the suggested command?

git branch --set-upstream-to=miguelmartins17-patch4

Followed by:

git pull
nelsonic commented 4 years ago

@miguelmartins17 any luck/update?

nelsonic commented 4 years ago

@miguelmartins17 please run this commend in your terminal:

git remote set-url origin git@github.com:dwyl/flutter-counter-example.git
git push -u origin master
miguelmartins17 commented 4 years ago

https://github.com/dwyl/flutter-counter-example

I finished on pushing the empty project to this repository.

nelsonic commented 4 years ago

@miguelmartins17 now that you have your SSH key setup for GitHub, 🔐 you should be able to push code to GitHub without any issues. 👍

miguelmartins17 commented 4 years ago

@nelsonic Thanks!!! 😄