How to add a new project to an existing GitHub repository

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ค. 2022
  • Need to push a new project to GitHub? This Git push tutorial will show you exactly how to do it. Simply create a new, or use an existing, GitHub repository, create a local Git repository, and then after you add and commit, use the git add command to connect the new project to the existing GitHub repo. After the Git remote is added, just perform a push. That will push your new project to the existing GitHub repository in the cloud!

ความคิดเห็น • 94

  • @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

  • @dannixon5313
    @dannixon5313 ปีที่แล้ว +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!

  • @YoN1187
    @YoN1187 9 หลายเดือนก่อน +8

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

    • @cameronmcnz
      @cameronmcnz  9 หลายเดือนก่อน +1

      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!
      th-cam.com/video/ueQs5pQ8ZMM/w-d-xo.html

    • @YoN1187
      @YoN1187 8 หลายเดือนก่อน

      @@cameronmcnz Haha. Thanks!

  • @shanebracken-ox7mt
    @shanebracken-ox7mt ปีที่แล้ว +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 9 หลายเดือนก่อน

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

  • @prashansa6019
    @prashansa6019 12 วันที่ผ่านมา

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

  • @javierpacheco4566
    @javierpacheco4566 11 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  11 หลายเดือนก่อน

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

  • @NNNedlog
    @NNNedlog ปีที่แล้ว

    I love your style of explanation sir. Great tutorial

  • @MikixIT
    @MikixIT ปีที่แล้ว

    the BEST video about that! Thank you so much.

  • @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!

  • @kyleh1448
    @kyleh1448 3 หลายเดือนก่อน +1

    Thanks a ton, Cameron. Super helpful stuff here!

    • @cameronmcnz
      @cameronmcnz  3 หลายเดือนก่อน

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

  • @sakshi-ok8zu
    @sakshi-ok8zu ปีที่แล้ว

    clear and concise! thanks for the tutorial.

  • @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😍😍

  • @ReginaldMcPherson
    @ReginaldMcPherson ปีที่แล้ว

    Hey thanks man, much appreciated!

  • @jawad_youtube
    @jawad_youtube 6 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  6 หลายเดือนก่อน +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.
      th-cam.com/video/jq1ROBgmEzw/w-d-xo.html

  • @teodortodorov4042
    @teodortodorov4042 ปีที่แล้ว +1

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

  • @damienbizimungu2231
    @damienbizimungu2231 3 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  3 หลายเดือนก่อน

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

  • @soulforthekindheart3766
    @soulforthekindheart3766 ปีที่แล้ว

    this helped me so much, thank you

  • @eduardopassero47
    @eduardopassero47 5 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  5 หลายเดือนก่อน +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!
      th-cam.com/video/ueQs5pQ8ZMM/w-d-xo.htmlsi=uPOj817npb_tmqPs

  • @fredoenzorodriguez7339
    @fredoenzorodriguez7339 6 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  6 หลายเดือนก่อน

      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

  • @chef_david1
    @chef_david1 ปีที่แล้ว

    Thank you for making it easy for us

  • @diminaa
    @diminaa ปีที่แล้ว

    thanks a million! you helped a lot!

  • @iyng._.uuuuuu
    @iyng._.uuuuuu 5 หลายเดือนก่อน +1

    Thank you so much, It was soo useful

    • @cameronmcnz
      @cameronmcnz  5 หลายเดือนก่อน

      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.
      th-cam.com/video/jq1ROBgmEzw/w-d-xo.html

  • @specs7195
    @specs7195 9 หลายเดือนก่อน

    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

  • @sms_521
    @sms_521 หลายเดือนก่อน +1

    that force -f did well for me. thanks

    • @cameronmcnz
      @cameronmcnz  หลายเดือนก่อน

      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!

  • @nethranjaleewijesinghe6011
    @nethranjaleewijesinghe6011 7 หลายเดือนก่อน +1

    wow thank u so much. i really love ur work

    • @cameronmcnz
      @cameronmcnz  7 หลายเดือนก่อน

      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!
      th-cam.com/video/ueQs5pQ8ZMM/w-d-xo.htmlsi=ek2Gmt6RE50t2kOy

  • @007devraj
    @007devraj 3 หลายเดือนก่อน

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

  • @MohamedMahmoud-pe6qm
    @MohamedMahmoud-pe6qm ปีที่แล้ว

    Thank you! God Bless You

  • @tonycyber
    @tonycyber 2 ปีที่แล้ว

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

  • @anthonyboyle6636
    @anthonyboyle6636 ปีที่แล้ว

    Thank you Cameron 👍

  • @CG0700
    @CG0700 11 หลายเดือนก่อน +1

    huge help thank you so much

    • @cameronmcnz
      @cameronmcnz  11 หลายเดือนก่อน

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

  • @kekoHere0610
    @kekoHere0610 4 หลายเดือนก่อน +1

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

    • @cameronmcnz
      @cameronmcnz  4 หลายเดือนก่อน +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!

  • @AbdulsalaamAzimi
    @AbdulsalaamAzimi ปีที่แล้ว

    Thanks for teaching

  • @devi9058
    @devi9058 ปีที่แล้ว

    Best video. It saved my day.

  • @dweebycat9929
    @dweebycat9929 ปีที่แล้ว

    Thank you so much!

  • @kcstorytime4898
    @kcstorytime4898 7 หลายเดือนก่อน +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  7 หลายเดือนก่อน

      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:
      th-cam.com/video/ueQs5pQ8ZMM/w-d-xo.htmlsi=kuW8T8fV3tPLTzAv

  • @Diego-yx8sv
    @Diego-yx8sv 7 วันที่ผ่านมา

    You're the best!

  • @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!

  • @82herrera
    @82herrera ปีที่แล้ว

    Thank you sir!!

  • @neosinpocket4184
    @neosinpocket4184 10 หลายเดือนก่อน +3

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

  • @g-dd-were5763
    @g-dd-were5763 ปีที่แล้ว +2

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

    • @cameronmcnz
      @cameronmcnz  ปีที่แล้ว +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?

  • @media7588
    @media7588 ปีที่แล้ว +1

    So Thanks 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.

  • @emilly.aguirre
    @emilly.aguirre ปีที่แล้ว

    thanks you!

  • @aspnet8430
    @aspnet8430 ปีที่แล้ว +1

    thanks...I subscribed :)

    • @cameronmcnz
      @cameronmcnz  ปีที่แล้ว

      Glad I could help! And thanks for the sub!

  • @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!

  • @dhruvchaurasia52
    @dhruvchaurasia52 ปีที่แล้ว

    Thankyou man

  • @quraanfmurdu2955
    @quraanfmurdu2955 ปีที่แล้ว

    you earned a subscriber as well as a like ❤❤

  • @wenlong1997
    @wenlong1997 ปีที่แล้ว

    Thanks!

  • @ThoboMaluleke
    @ThoboMaluleke 2 หลายเดือนก่อน +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 2 หลายเดือนก่อน

      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  2 หลายเดือนก่อน +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!

  • @abdelhadihabili2101
    @abdelhadihabili2101 2 หลายเดือนก่อน +1

    may the force be with u brother

    • @cameronmcnz
      @cameronmcnz  2 หลายเดือนก่อน

      This is the way.

  • @emad_arnesto9175
    @emad_arnesto9175 ปีที่แล้ว

    clearly and simple tutorial thank you sir

  • @nunopalomino
    @nunopalomino ปีที่แล้ว

    Thanks

  • @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.

  • @solysoly89
    @solysoly89 2 ปีที่แล้ว

    I subscribed!

  • @roweeapor
    @roweeapor ปีที่แล้ว +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  ปีที่แล้ว +1

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

  • @muzamilzaman9078
    @muzamilzaman9078 8 หลายเดือนก่อน +1

    I haven't seen .git folder

    • @cameronmcnz
      @cameronmcnz  8 หลายเดือนก่อน +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 8 หลายเดือนก่อน

      @@cameronmcnz got it thanks

  • @tonycyber
    @tonycyber 2 ปีที่แล้ว +1

    bro you were funny

  • @user-vr5qu4ye2d
    @user-vr5qu4ye2d 8 หลายเดือนก่อน

    No clue

    • @cameronmcnz
      @cameronmcnz  8 หลายเดือนก่อน

      Clues are free. What can I help you with?

  • @teothedoor
    @teothedoor ปีที่แล้ว

    may the -f be with you

  • @CB-rq1vo
    @CB-rq1vo ปีที่แล้ว

    what is the missouri joke ???

  • @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!