How to add a new project to an existing GitHub repository

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 92

  • @cameronmcnz
    @cameronmcnz  2 роки тому +4

    Here's an article I wrote on how to push an existing project to GitHub using the Git add remote and Git push commands. Check it out!
    www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-push-an-existing-project-to-GitHub

  • @YoN1187
    @YoN1187 Рік тому +10

    I come back to this video waaayy too many times then I would like to admit😁. Thanks Cameron!

    • @cameronmcnz
      @cameronmcnz  Рік тому +2

      Would you believe me if I told you that I do too?
      By the way, I produced a new version where you get to see my handsome face!
      ua-cam.com/video/ueQs5pQ8ZMM/v-deo.html

    • @YoN1187
      @YoN1187 Рік тому

      @@cameronmcnz Haha. Thanks!

  • @dannixon5313
    @dannixon5313 2 роки тому +4

    I've been struggling to get started with using git for a while now (I think I've been putting it off for a year or two now). I've looked at different courses and whatnot, but this video is the best intro I have seen. You did a great job pointing out all of the gotchyas that I haven't been able to wrap my head around. Thank you!

  • @shanebracken-ox7mt
    @shanebracken-ox7mt 2 роки тому +2

    man, thank you! I followed another tutorial that didn't mention force pushing … got stuck for a few hours until I found this video! thank you!

  • @bigswede88
    @bigswede88 Рік тому

    I must say that you are a great teacher and very easy to follow. You are born to teach.

  • @kekoHere0610
    @kekoHere0610 9 місяців тому +1

    Hi, Your video was very helpful. Thanks for posting this video.

    • @cameronmcnz
      @cameronmcnz  9 місяців тому +1

      Happy I can help! Git and GitHub gets much easier once you've got your local project and the remote repo connected together, trust me!

  • @prashansa-shrestha
    @prashansa-shrestha 6 місяців тому

    i'd been avoiding git for so long but this video finally helped me get started

  • @quraanfmurdu2955
    @quraanfmurdu2955 Рік тому

    from last 2 weeks my senior developers forcing me to push all my code to their exsiting repositories but I am tired of watching other youtubers then suddenly I clicked here and got my simple answer😍😍

  • @jawad_youtube
    @jawad_youtube Рік тому +2

    Clear, concise, to the point.
    Thanks , sir❤

    • @cameronmcnz
      @cameronmcnz  Рік тому +1

      Thanks! I actually have two better ways to do this if you run into problems with the server having a history and you don't want to force the push, which can mess things up if others have pulled from the repo. Feel free to check it out here.
      ua-cam.com/video/jq1ROBgmEzw/v-deo.html

  • @iyng._.uuuuuu
    @iyng._.uuuuuu 11 місяців тому +1

    Thank you so much, It was soo useful

    • @cameronmcnz
      @cameronmcnz  11 місяців тому

      Glad I could help! I just updated this video with an easier 'cheat method' along with a rebase option that avoids the 'force push.' But if you got what you needed, that's all that matters! Thanks for the kind words.
      ua-cam.com/video/jq1ROBgmEzw/v-deo.html

  • @javierpacheco4566
    @javierpacheco4566 Рік тому +1

    Thank you for the video! It help upload an existing project in a different address to the same GitHub repo. Thank!

    • @cameronmcnz
      @cameronmcnz  Рік тому

      I just did a video suggesting a different, easier strategy. I wonder if this would have worked for you as well?
      ua-cam.com/video/ueQs5pQ8ZMM/v-deo.html

  • @neosinpocket4184
    @neosinpocket4184 Рік тому +4

    all these 63k views are from me trying every time to remember how to create project in github

  • @damienbizimungu2231
    @damienbizimungu2231 9 місяців тому +1

    Truly you save me ,Much respect indeed for your work 🙏

    • @cameronmcnz
      @cameronmcnz  9 місяців тому

      Happy to be of service! Once this Git connectivity stuff gets solved, Git and GitHub becomes a lot easier, trust me!

  • @ThoboMaluleke
    @ThoboMaluleke 8 місяців тому +1

    what if i already have a gihub repository i want to add my js file and my images properly how do i do it .

    • @ThoboMaluleke
      @ThoboMaluleke 8 місяців тому

      I think I did not link my images properly and I forgot to add my js but i don't want my URL to change at all i noticed that you did that command to create a new repository but like I already said I have it - I just need to link my images and add my js file how do it

    • @cameronmcnz
      @cameronmcnz  8 місяців тому +1

      @@ThoboMaluleke One way? Just clone the repo. The just copy your files into the cloned repo in the right spot, do a git add, git commit and then git push back to the server.
      There you go! You're all caught up!

  • @kyleh1448
    @kyleh1448 9 місяців тому +1

    Thanks a ton, Cameron. Super helpful stuff here!

    • @cameronmcnz
      @cameronmcnz  9 місяців тому

      Happy to help. It all gets a lot easier once the connectivity is configured!

  • @luckyjones6509
    @luckyjones6509 2 роки тому +5

    This was very easy to follow. Thank you!

    • @cameronmcnz
      @cameronmcnz  2 роки тому +1

      Well, next to rebasing, I think that's one of the harder things in Git to do. So you'll have no problem with all the other Git topics. Thanks so much for the kind words!

  • @kcstorytime4898
    @kcstorytime4898 Рік тому +1

    For clarification purposes, I have a mac computer and I use terminal which has command line , when you refer to a GitBash Shell inside the local folder, are you referring to me opening up terminal on my mac and cd to the root directory of my project on my computer and inside that directory I do all the Git commands from there ? I am asking as that is what it looks like you are doing but I want to make certain I am not in error as I am wanting to properly push stuff I build on my computer to github .

    • @cameronmcnz
      @cameronmcnz  Рік тому

      Yes, you will run these commands from the root folder of the project.
      There should be a hidden folder in there named .git.
      By the way, I did update this video with a slightly easier way to do it if you're interested:
      ua-cam.com/video/ueQs5pQ8ZMM/v-deo.htmlsi=kuW8T8fV3tPLTzAv

  • @AhmdIsmail
    @AhmdIsmail Рік тому +1

    3:15 If you don't do the force, well, the force won't be with you 😂

    • @cameronmcnz
      @cameronmcnz  Рік тому

      You're hired as my new writer! Thanks for watching past the 3:15 mark!

  • @fredoenzorodriguez7339
    @fredoenzorodriguez7339 Рік тому +1

    Yeaaaaah booy...❤❤ after a long search.. thanks Cameron. Am from Cameroon 😅

    • @cameronmcnz
      @cameronmcnz  Рік тому

      My spirit-country!!! ❤Glad I could help.
      I have an updated video with a trick that makes it easier, but it may be too late for that now. Whatever works!
      Will have a 2 hour git and github video out next week with better audio and video. Stay tuned!
      www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-push-an-existing-project-to-GitHub

  • @eduardopassero47
    @eduardopassero47 11 місяців тому +1

    Damn, you just got a subscriber! Thank you so much!

    • @cameronmcnz
      @cameronmcnz  11 місяців тому +1

      Glad I could help! Once you get everything connected, Git and GitHub becomes a whole lot easier! I actually updated this video with better audio and video. Helping people love Git and GitHub one person at a time!
      ua-cam.com/video/ueQs5pQ8ZMM/v-deo.htmlsi=uPOj817npb_tmqPs

  • @NNNedlog
    @NNNedlog Рік тому

    I love your style of explanation sir. Great tutorial

  • @sms_521
    @sms_521 6 місяців тому +1

    that force -f did well for me. thanks

    • @cameronmcnz
      @cameronmcnz  6 місяців тому

      Awesome! Now that's best if only you use the repo. If someone else is pushing and pulling, they'll need to re-clone that repo after a forced push. The other option is to rebase, which is safer but a bit more intimidating.
      Glad I could help!

  • @007devraj
    @007devraj 9 місяців тому

    this video really helpful, thanks for your amazing effort.❣

  • @MikixIT
    @MikixIT 2 роки тому

    the BEST video about that! Thank you so much.

  • @G-D-wert
    @G-D-wert 2 роки тому +2

    Hi, but how do I upload to 'main' (!) (and how do I merge 'master' with 'main' after your tutorial? ) Thanks! 🙏

    • @cameronmcnz
      @cameronmcnz  2 роки тому +1

      So, new repos use main, older ones master. Is main on the server or the local?
      If you have a repo with just master, you can create a new branch called main. Then merge master into main.
      I didn't test these commands but it'd be something like this:
      git switch master // this creates a master branch
      git merge main // this merges main into master so the two are the same
      Something like that?

  • @muzamilzaman9078
    @muzamilzaman9078 Рік тому +1

    I haven't seen .git folder

    • @cameronmcnz
      @cameronmcnz  Рік тому +1

      It's a hidden folder so you have to set Windows folder options to show hidden folders.
      I think on the command line/Git BASH you can do ls -a and that shows hidden folders as well.
      Make sure you are *in* the folder for the project, not a subfolder. After you clone you must CD into the folder Git creates for you.

    • @muzamilzaman9078
      @muzamilzaman9078 Рік тому

      @@cameronmcnz got it thanks

  • @nethranjaleewijesinghe6011
    @nethranjaleewijesinghe6011 Рік тому +1

    wow thank u so much. i really love ur work

    • @cameronmcnz
      @cameronmcnz  Рік тому

      Thanks for the kind words!
      I actually have a new version of this with a few tricks to make it easier, although the video you watched is the 'official way.'
      Also upgraded my mic and got in front of the camera so you can see my handsome face.
      Again, thanks for the encouraging words!
      ua-cam.com/video/ueQs5pQ8ZMM/v-deo.htmlsi=ek2Gmt6RE50t2kOy

  • @teodortodorov4042
    @teodortodorov4042 2 роки тому +1

    Thank you a lot man. Saved me some time :)

  • @mamamama-jw7et
    @mamamama-jw7et Рік тому +1

    thank you you are my hero

    • @cameronmcnz
      @cameronmcnz  Рік тому

      Being a great dev is all about knowing how to find answers to your problems. You're the hero. You're the one that found the path. I'm just happy to be part of your Git journey.
      It all gets easier from her on in!

  • @sakshi-ok8zu
    @sakshi-ok8zu 2 роки тому

    clear and concise! thanks for the tutorial.

  • @ReginaldMcPherson
    @ReginaldMcPherson 2 роки тому

    Hey thanks man, much appreciated!

  • @devi9058
    @devi9058 Рік тому

    Best video. It saved my day.

  • @MohamedMahmoud-pe6qm
    @MohamedMahmoud-pe6qm Рік тому

    Thank you! God Bless You

  • @ojramos07
    @ojramos07 Рік тому +1

    Hi, Great video, I've done this before. I have a unique issue or an issue that I haven't come across as of yet. How to I push or merge a local project to a GitHub repo that already have the same files? So in this caas I have local files and I have the same GitHub files on the remote however the local files aren't setup to use git yet but I want to setup the files to work with the existing files in my GitHub repository. Hope I explained the correctly.

    • @cameronmcnz
      @cameronmcnz  Рік тому +1

      A few ways.
      What about this:
      git clone
      create a new git branch
      delete all the files in the new branch.
      copy your project files into that same folder.
      do a git add and git commit
      Now all YOUR files are in that new branch. And the project files are in teh other branch.
      Then you can just merge stuff back and forth.
      I've done stuff like that before.

    • @ojramos07
      @ojramos07 Рік тому

      @@cameronmcnz Thanks. I'll give that a try.

  • @soulforthekindheart3766
    @soulforthekindheart3766 2 роки тому

    this helped me so much, thank you

  • @chef_david1
    @chef_david1 Рік тому

    Thank you for making it easy for us

  • @anthonyboyle6636
    @anthonyboyle6636 Рік тому

    Thank you Cameron 👍

  • @CG0700
    @CG0700 Рік тому +1

    huge help thank you so much

    • @cameronmcnz
      @cameronmcnz  Рік тому

      You helped yourself by looking in the right spot for a quick answer. Trust me, git gets way easier from here on in!

  • @diminaa
    @diminaa Рік тому

    thanks a million! you helped a lot!

  • @AbdulsalaamAzimi
    @AbdulsalaamAzimi Рік тому

    Thanks for teaching

  • @tonycyber
    @tonycyber 2 роки тому

    so my git push -u -f main master ... states "100%" .... but the cursor is still loading.... any idea why ?

  • @emad_arnesto9175
    @emad_arnesto9175 2 роки тому

    clearly and simple tutorial thank you sir

  • @quraanfmurdu2955
    @quraanfmurdu2955 Рік тому

    you earned a subscriber as well as a like ❤❤

  • @aspnet8430
    @aspnet8430 2 роки тому +1

    thanks...I subscribed :)

    • @cameronmcnz
      @cameronmcnz  2 роки тому

      Glad I could help! And thanks for the sub!

  • @specs7195
    @specs7195 Рік тому

    how do i add new file on existing repository like for example i already push a file on a git repository then i want to add another how do i add it

  • @media7588
    @media7588 Рік тому +1

    So Thanks You

  • @Diego-yx8sv
    @Diego-yx8sv 6 місяців тому

    You're the best!

  • @dweebycat9929
    @dweebycat9929 Рік тому

    Thank you so much!

  • @82herrera
    @82herrera 2 роки тому

    Thank you sir!!

  • @solysoly89
    @solysoly89 2 роки тому

    I subscribed!

  • @dhruvchaurasia52
    @dhruvchaurasia52 2 роки тому

    Thankyou man

  • @roweeapor
    @roweeapor 2 роки тому +2

    The title says add a new project to an "existing" github repo and yet you created a new repo. That is hilarious! 😅🤣

    • @cameronmcnz
      @cameronmcnz  2 роки тому +1

      Well, it doesn't exist until you create it!

  • @emilly.aguirre
    @emilly.aguirre 2 роки тому

    thanks you!

  • @pezcue937
    @pezcue937 2 роки тому

    the git doesn't read all my file, only the read me. I don't understand

    • @cameronmcnz
      @cameronmcnz  2 роки тому

      Make sure you do the git add. Also make sure you are on the right branch. Check your available branches.

  • @wenlong1997
    @wenlong1997 2 роки тому

    Thanks!

  • @nunopalomino
    @nunopalomino Рік тому

    Thanks

  • @tonycyber
    @tonycyber 2 роки тому +1

    bro you were funny

  • @MattHerbert-g1z
    @MattHerbert-g1z Рік тому

    No clue

    • @cameronmcnz
      @cameronmcnz  Рік тому

      Clues are free. What can I help you with?

  • @jfinthetrap
    @jfinthetrap Рік тому

    1st time it was too hard

  • @romasokolov2894
    @romasokolov2894 Рік тому +1

    wtf are these steps

    • @cameronmcnz
      @cameronmcnz  Рік тому

      All documented in more detail here:
      www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-push-an-existing-project-to-GitHub
      Let me know if you have any questions!

  • @teothedoor
    @teothedoor Рік тому

    may the -f be with you

  • @CB-rq1vo
    @CB-rq1vo Рік тому

    what is the missouri joke ???