No video

How to add a new project to an existing GitHub repository

  Рет қаралды 90,175

Cameron McKenzie

Cameron McKenzie

Күн бұрын

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 жыл бұрын
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 10 ай бұрын
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! kzfaq.info/get/bejne/q8uBppihtp6-fYE.html
@YoN1187
@YoN1187 9 ай бұрын
@@cameronmcnz Haha. Thanks!
@prashansa-shrestha
@prashansa-shrestha Ай бұрын
i'd been avoiding git for so long but this video finally helped me get started
@dannixon5313
@dannixon5313 2 жыл бұрын
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 Жыл бұрын
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!
@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😍😍
@minhkhoivotan6546
@minhkhoivotan6546 4 ай бұрын
Have you been fired ?
@bigswede88
@bigswede88 9 ай бұрын
I must say that you are a great teacher and very easy to follow. You are born to teach.
@jawad_youtube
@jawad_youtube 7 ай бұрын
Clear, concise, to the point. Thanks , sir❤
@cameronmcnz
@cameronmcnz 6 ай бұрын
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. kzfaq.info/get/bejne/oNdhhbJzzNOpqqs.html
@fredoenzorodriguez7339
@fredoenzorodriguez7339 7 ай бұрын
Yeaaaaah booy...❤❤ after a long search.. thanks Cameron. Am from Cameroon 😅
@cameronmcnz
@cameronmcnz 7 ай бұрын
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
@damienbizimungu2231
@damienbizimungu2231 4 ай бұрын
Truly you save me ,Much respect indeed for your work 🙏
@cameronmcnz
@cameronmcnz 4 ай бұрын
Happy to be of service! Once this Git connectivity stuff gets solved, Git and GitHub becomes a lot easier, trust me!
@javierpacheco4566
@javierpacheco4566 Жыл бұрын
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? kzfaq.info/get/bejne/q8uBppihtp6-fYE.html
@sms_521
@sms_521 Ай бұрын
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!
@luckyjones6509
@luckyjones6509 2 жыл бұрын
This was very easy to follow. Thank you!
@cameronmcnz
@cameronmcnz 2 жыл бұрын
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 4 ай бұрын
Thanks a ton, Cameron. Super helpful stuff here!
@cameronmcnz
@cameronmcnz 4 ай бұрын
Happy to help. It all gets a lot easier once the connectivity is configured!
@eduardopassero47
@eduardopassero47 6 ай бұрын
Damn, you just got a subscriber! Thank you so much!
@cameronmcnz
@cameronmcnz 6 ай бұрын
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! kzfaq.info/get/bejne/q8uBppihtp6-fYE.htmlsi=uPOj817npb_tmqPs
@NNNedlog
@NNNedlog Жыл бұрын
I love your style of explanation sir. Great tutorial
@kekoHere0610
@kekoHere0610 4 ай бұрын
Hi, Your video was very helpful. Thanks for posting this video.
@cameronmcnz
@cameronmcnz 4 ай бұрын
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!
@neosinpocket4184
@neosinpocket4184 11 ай бұрын
all these 63k views are from me trying every time to remember how to create project in github
@AhmdIsmail
@AhmdIsmail Жыл бұрын
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!
@007devraj
@007devraj 4 ай бұрын
this video really helpful, thanks for your amazing effort.❣
@MikixIT
@MikixIT Жыл бұрын
the BEST video about that! Thank you so much.
@devi9058
@devi9058 Жыл бұрын
Best video. It saved my day.
@iyng._.uuuuuu
@iyng._.uuuuuu 6 ай бұрын
Thank you so much, It was soo useful
@cameronmcnz
@cameronmcnz 6 ай бұрын
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. kzfaq.info/get/bejne/oNdhhbJzzNOpqqs.html
@Diego-yx8sv
@Diego-yx8sv Ай бұрын
You're the best!
@nethranjaleewijesinghe6011
@nethranjaleewijesinghe6011 8 ай бұрын
wow thank u so much. i really love ur work
@cameronmcnz
@cameronmcnz 8 ай бұрын
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! kzfaq.info/get/bejne/q8uBppihtp6-fYE.htmlsi=ek2Gmt6RE50t2kOy
@MohamedMahmoud-pe6qm
@MohamedMahmoud-pe6qm Жыл бұрын
Thank you! God Bless You
@CG0700
@CG0700 Жыл бұрын
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!
@abdelhadihabili2101
@abdelhadihabili2101 3 ай бұрын
may the force be with u brother
@cameronmcnz
@cameronmcnz 3 ай бұрын
This is the way.
@AbdulsalaamAzimi
@AbdulsalaamAzimi Жыл бұрын
Thanks for teaching
@teodortodorov4042
@teodortodorov4042 Жыл бұрын
Thank you a lot man. Saved me some time :)
@chef_david1
@chef_david1 Жыл бұрын
Thank you for making it easy for us
@anthonyboyle6636
@anthonyboyle6636 Жыл бұрын
Thank you Cameron 👍
@sakshi-ok8zu
@sakshi-ok8zu Жыл бұрын
clear and concise! thanks for the tutorial.
@media7588
@media7588 Жыл бұрын
So Thanks You
@mamamama-jw7et
@mamamama-jw7et Жыл бұрын
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!
@ReginaldMcPherson
@ReginaldMcPherson Жыл бұрын
Hey thanks man, much appreciated!
@soulforthekindheart3766
@soulforthekindheart3766 Жыл бұрын
this helped me so much, thank you
@emad_arnesto9175
@emad_arnesto9175 Жыл бұрын
clearly and simple tutorial thank you sir
@diminaa
@diminaa Жыл бұрын
thanks a million! you helped a lot!
@g-dd-were5763
@g-dd-were5763 Жыл бұрын
Hi, but how do I upload to 'main' (!) (and how do I merge 'master' with 'main' after your tutorial? ) Thanks! 🙏
@cameronmcnz
@cameronmcnz Жыл бұрын
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?
@dweebycat9929
@dweebycat9929 Жыл бұрын
Thank you so much!
@aspnet8430
@aspnet8430 Жыл бұрын
thanks...I subscribed :)
@cameronmcnz
@cameronmcnz Жыл бұрын
Glad I could help! And thanks for the sub!
@kcstorytime4898
@kcstorytime4898 8 ай бұрын
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 8 ай бұрын
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: kzfaq.info/get/bejne/q8uBppihtp6-fYE.htmlsi=kuW8T8fV3tPLTzAv
@82herrera
@82herrera Жыл бұрын
Thank you sir!!
@ojramos07
@ojramos07 Жыл бұрын
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 Жыл бұрын
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.
@quraanfmurdu2955
@quraanfmurdu2955 Жыл бұрын
you earned a subscriber as well as a like ❤❤
@roweeapor
@roweeapor Жыл бұрын
The title says add a new project to an "existing" github repo and yet you created a new repo. That is hilarious! 😅🤣
@cameronmcnz
@cameronmcnz Жыл бұрын
Well, it doesn't exist until you create it!
@nunopalomino
@nunopalomino Жыл бұрын
Thanks
@wenlong1997
@wenlong1997 Жыл бұрын
Thanks!
@dhruvchaurasia52
@dhruvchaurasia52 Жыл бұрын
Thankyou man
@emilly.aguirre
@emilly.aguirre Жыл бұрын
thanks you!
@ThoboMaluleke
@ThoboMaluleke 3 ай бұрын
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 3 ай бұрын
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 3 ай бұрын
@@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!
@specs7195
@specs7195 10 ай бұрын
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
@tonycyber
@tonycyber 2 жыл бұрын
so my git push -u -f main master ... states "100%" .... but the cursor is still loading.... any idea why ?
@solysoly89
@solysoly89 2 жыл бұрын
I subscribed!
@muzamilzaman9078
@muzamilzaman9078 9 ай бұрын
I haven't seen .git folder
@cameronmcnz
@cameronmcnz 9 ай бұрын
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 9 ай бұрын
@@cameronmcnz got it 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.
@tonycyber
@tonycyber 2 жыл бұрын
bro you were funny
@teothedoor
@teothedoor Жыл бұрын
may the -f be with you
@CB-rq1vo
@CB-rq1vo Жыл бұрын
what is the missouri joke ???
@user-vr5qu4ye2d
@user-vr5qu4ye2d 9 ай бұрын
No clue
@cameronmcnz
@cameronmcnz 9 ай бұрын
Clues are free. What can I help you with?
@jfinthetrap
@jfinthetrap Жыл бұрын
1st time it was too hard
@romasokolov2894
@romasokolov2894 Жыл бұрын
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!
How to upload a project / folder to GitHub
9:14
Abstract programmer
Рет қаралды 75 М.
How to Push Code to a GitHub Repository
15:29
Cameron McKenzie
Рет қаралды 43 М.
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 16 МЛН
123 GO! Houseによる偽の舌ドッキリ 😂👅
00:20
123 GO! HOUSE Japanese
Рет қаралды 4,9 МЛН
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 39 МЛН
How to Add & Upload a New Project to an Existing GitLab repository
5:18
Cameron McKenzie
Рет қаралды 71 М.
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,1 МЛН
Add Locally Hosted Code to GitHub using Command Line
6:18
JasheleTechTV
Рет қаралды 662
How to add Existing project to a GitHub Repository?
3:06
Ervis Trupja
Рет қаралды 428 М.
Uploading Files To GitHub Quick Start Guide
12:37
Dennis Ivy
Рет қаралды 403 М.
GitHub Basics Made Easy: A Fast Beginner's Tutorial!
23:30
Skill Foundry
Рет қаралды 96 М.
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 16 МЛН