Troubleshooting: Updates Rejected When Pushing to GitHub

  Рет қаралды 82,680

Data School

Data School

10 жыл бұрын

This is video #11 in the Data School series, "Introduction to Git and GitHub." Relevant links and the full transcript are below. Playlist: • Version control with G...
== LINKS ==
Git quick reference for beginners: www.dataschool.io/git-quick-re...
== TRANSCRIPT ==
In this video, we're going to talk about one of the most common problems users run into when pushing to a new GitHub repository. First, I'll show you the problem and how to resolve it. Then, I'll show you two ways to avoid running into that problem in the first place.
I'll be working through the examples quickly, since all of the commands in this video are explained in previous videos. If you get lost, just watch the rest of the series and then come back to this video.
Anyway, I'll start by demonstrating the problem. Let's create a repo on GitHub and initialize it with a README file. Our plan is to create a local Git repo, add a file to the local repo, and then get that repo synchronized with GitHub.
Let's create a subdirectory on our local machine with the same name as the GitHub repo, though you can actually use any name you like. We then "change directory" to the subdirectory, and initialize Git with "git init".
Now, we'll add a "remote" that allows you to easily reference your GitHub repo later. You type "git remote add origin" and then the URL, which will either be an HTTPS URL, or in my case, an SSH URL.
I created a simple text file before the video, which I'll now copy into my local repository. Running "git status" confirms that Git has detected an untracked file. Now we'll stage that file to be committed with "git add ." and we'll commit the file with "git commit -m" and a message.
Finally, we'll push the file using "git push origin master", which directs Git to push the committed changes on the master branch to the origin that we defined earlier. Unfortunately, there's an error which says that the updates were rejected because the remote contains work that we don't have locally.
So why is this error occurring? It's a bit complicated, but the root of the problem is that you initialized the GitHub repo with a README file. That actually added and committed a file to your GitHub repo, which is not a file your local repo knows about. So when you try to push your text file up to GitHub, Git is confused about why your local repo doesn't have the README file in it. Git correctly guesses that you are probably trying to sync these two repos, but it would rather have you fix the problem manually than guess how to automatically fix the problem for you.
So to manually fix this problem, you simply need to update your local repo with what has already occurred in your GitHub repo. To do this, we'll use the command "git pull origin master", which fetches the README file from your GitHub repo and merges it into your local repo. Now, you can once again try "git push origin master", and this time it will be successful. We can refresh the repo on GitHub, and confirm that the text file is indeed there.
Now, let's talk about two ways that you could have avoided running into this problem in the first place.
The first way would be to follow the exact same steps I did in this video, except don't check the box to initialize the GitHub repo with a README. That way, your GitHub repo will initially be empty, and you won't get an error the first time you try to push.
The second way, which I personally prefer, is to use a cloning approach. If you've watched the rest of this video series, the cloning approach will look familiar, but I'll demonstrate it here quickly. In this approach, you first create a GitHub repo and you must initialize it with a README.
Then, you clone this repo to your local machine using "git clone" followed by the repo URL. Cloning automatically downloads the GitHub repo and stores it in a subdirectory of your working directory. It also automatically sets up your origin remote, so you don't have to add the remote manually. And most importantly, your local repo and the GitHub repo are already in sync.
Now, we can just copy the text file into our local repo, add it, commit it, and push. Refresh GitHub, and you'll see that the text file is there.
To conclude, let me just quickly summarize this video. If you run into the problem where your push is rejected, you may just need to "git pull origin master" before you "git push origin master". If you want to avoid this problem in the first place, there are two easy ways to avoid it. One way is to follow the first part of this video but don't check the README box when creating your GitHub repo. The other way is to follow the cloning approach from the end of the video, in which you do include a README on GitHub but you use "git clone" instead of "git init" locally. Note that GitHub does not allow you to clone an empty repo, which is why you must check the box to include a README if you're going to clone.

Пікірлер: 252
@vaibhavsinghal1122
@vaibhavsinghal1122 4 жыл бұрын
Thank you, you are a life saver. I was going crazy because of this issue and I didn't know how to troubleshoot it, and then I started doubting whether I will ever make it as a software developer, then I doubted my entire existence, and I almost cried. This was yesterday and today I saw your video and finally fixed my error. Thank you so much!
@dataschool
@dataschool 3 жыл бұрын
You're very welcome!
@kittieCoder
@kittieCoder 8 жыл бұрын
Thanks for your whole playlist of Git and GitHub videos. I'm preparing to start the Johns Hopkins/Coursera Data Science Specialization tomorrow with Data Scientist's Toolbox and Introduction to R so I wanted to get the DST done asap so I'll have the rest of the month to just focus on The R one. I really appreciate how you distilled the most important things to know to get started successfully and demo-ed everything.
@dataschool
@dataschool 8 жыл бұрын
+SeaAnemone Awesome! Thanks for your very kind comments. Good luck with the Specialization!
@vivekunique90
@vivekunique90 7 жыл бұрын
I was trying to learn Github from a long time and my journey ends with your videos.It's really well explained and well executed.Really loved the videos.Thanks a lot for sharing info.
@dataschool
@dataschool 7 жыл бұрын
Awesome! So glad to hear that the videos have been helpful to you, and thanks for your kind compliments! :)
@bytesizedut
@bytesizedut 9 жыл бұрын
Thanks so much. I am just learning to use git and github. I encountered it in a class and it was required to become proficient. Your excellent videos help me accomplish what I needed to do. Thanks again.
@-anvarcanada4657
@-anvarcanada4657 5 жыл бұрын
Thank you so much! It showed me the solution to the problem that I encountered when trying to push to bitbucket from sourcetree. Just did PULL and then after that all worked perfectly and the problem is gone! You are awesome!
@dataschool
@dataschool 5 жыл бұрын
Great to hear!
@dravidiandavid819
@dravidiandavid819 8 жыл бұрын
Thank you for such a comprehensive, well-paced tutorial.
@dataschool
@dataschool 8 жыл бұрын
+Dravidian David You're very welcome! Thanks for your kind words.
@AshishSahu25
@AshishSahu25 7 жыл бұрын
You are an excellent instructor. I bumped into the same kind of error and was looking for the answers in stack overflow, but couldn't understand what's going on. Thanks a lot. That helped :)
@dataschool
@dataschool 7 жыл бұрын
Excellent! I'm glad to hear that I was able to help you work past your problem!
@mnsegler
@mnsegler 9 жыл бұрын
Kudos for a great set of videos! Very helpful. Very easy to follow. Kevin is an excellent instructor!
@dataschool
@dataschool 9 жыл бұрын
mnsegler What a nice comment, thank you! :)
@EzekielCarvalho
@EzekielCarvalho 2 жыл бұрын
You just saved me from having to do further research to solve an issue I encountered while using Github. Thanks man. Muito obrigado!
@dataschool
@dataschool 2 жыл бұрын
You're very welcome!
@BudFieldsPPTS
@BudFieldsPPTS 9 жыл бұрын
This is the one that solved my difficulty and I thank you very much for it. Now I can submit my project! :) In fact, I just did!
@dataschool
@dataschool 9 жыл бұрын
Bud Fields that's awesome! I'm happy to hear... that is exactly why I created this video :) Are there any lingering questions you have about Git or GitHub? (I'm always gathering topics for future videos!)
@jeannemccabe5752
@jeannemccabe5752 7 жыл бұрын
Thank you for this tutorial. I too appreciate the slow pace. I will still have to review it a few times!!!!
@dataschool
@dataschool 7 жыл бұрын
You're very welcome... good luck!
@elprofeCristianJimenez
@elprofeCristianJimenez 4 жыл бұрын
Thank you from somebody who is just learning how to do lines of code ... again: thank you very much !
@skconform
@skconform 5 жыл бұрын
You're great man! Very clear explanation and very helpful. Thank you very much for your help and for such a great way of explaining things!
@dataschool
@dataschool 5 жыл бұрын
Thanks! :)
@raya8540
@raya8540 Жыл бұрын
Thank you very much!!! You are save me! I'm stuck on this error for a few hour & saw your video. That is very HELPFUL! THANKYOU!
@dataschool
@dataschool Жыл бұрын
Glad it helped! You're very welcome!
@kentmakishi648
@kentmakishi648 9 жыл бұрын
A big THANK YOU for the video series, especially this one that helped solve my "project part 3" problem.
@dataschool
@dataschool 9 жыл бұрын
Kent Makishi You're very welcome! Congratulations on getting through it! With practice, it becomes easier to remember the most common Git and GitHub "patterns". Are you planning on taking the entire Data Science Specialization?
@iMed-Med
@iMed-Med 6 жыл бұрын
Thank you very much, I have been struggling for a week over this error, you are a life saver
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@5b9saipranav.y89
@5b9saipranav.y89 2 жыл бұрын
Hi Kevin. Thanks for the fix! I was really confused and tried many methods (like deleting the file and creating a new file with the same name). Great explanation of the topics!
@dataschool
@dataschool 2 жыл бұрын
Thank you!
@milosm4456
@milosm4456 8 жыл бұрын
Great Explanation. Very clear and slow, that everybody could understand.
@dataschool
@dataschool 8 жыл бұрын
+Milos m Thanks!
@yiminko6850
@yiminko6850 9 жыл бұрын
It's a great series of video. Kevin is such an wonderful instructor. Thank you! Are there more videos coming out?
@dataschool
@dataschool 9 жыл бұрын
YM Ko I'm not currently working on any Git videos, but let me know if you have a specific Git topic you want me to cover! However, I am in the middle of a video series on machine learning in Python. Videos are released every other week.
@alighoneimy8041
@alighoneimy8041 9 жыл бұрын
Thanks a mil. I have tried many approaches to solve the problem but that one helped me a lot
@dataschool
@dataschool 9 жыл бұрын
+ali ghoneimy You're welcome!
@min11benja
@min11benja 5 жыл бұрын
Such a great and simple explination! thank you ever so much!
@dataschool
@dataschool 5 жыл бұрын
You're welcome!
@ankityaduwanshi3668
@ankityaduwanshi3668 3 жыл бұрын
That 2nd option helped me...thanks for the quick and easy solution
@dataschool
@dataschool 3 жыл бұрын
You're welcome!
@salvodavi2426
@salvodavi2426 10 жыл бұрын
i was getting crazy with that problem! Thank you :D
@manongiphilip4737
@manongiphilip4737 9 жыл бұрын
Tens of helpsites, forums and ebooks, buckets of sweat and tears, simple solution found here..! Project Submitted! Awesome!
@dataschool
@dataschool 9 жыл бұрын
Manongi Philip That's excellent! Great to hear... I knew this was a video worth making :)
@DarshanJainStud
@DarshanJainStud 4 жыл бұрын
Thank you. This video was very helpful.
@cesar.vasconcelos
@cesar.vasconcelos 6 жыл бұрын
Awesome explanation, Kevin. Thanks!
@dataschool
@dataschool 6 жыл бұрын
You're very welcome!
@Pavel0793
@Pavel0793 7 жыл бұрын
Great approach, I have fixed my problem with cloning, thanks mate
@dataschool
@dataschool 7 жыл бұрын
You're welcome!
@minoyjose
@minoyjose 9 жыл бұрын
Thanks a lot Kevin. Very helpful and well articulated.
@dataschool
@dataschool 9 жыл бұрын
Minoy Jose You're very welcome! Thanks for your kind comment.
@free2idol1
@free2idol1 4 жыл бұрын
thanks... I am newbie to programing world and you tutorial helps me a lot
@dataschool
@dataschool 4 жыл бұрын
That's great to hear!
@alannahrudkin5444
@alannahrudkin5444 9 жыл бұрын
Great video, easy to follow and very informative. Thank you.
@dataschool
@dataschool 9 жыл бұрын
Alannah Rudkin Great to hear, that was my exact goal! :)
@BoshenZhang
@BoshenZhang 8 жыл бұрын
loud and clear. Thank you very much !!
@dataschool
@dataschool 8 жыл бұрын
+boshen zhang You're welcome!
@chaki38
@chaki38 2 жыл бұрын
thanks my brother you saved my life on my project.
@dataschool
@dataschool 2 жыл бұрын
Great to hear!
@lynndeejohnson
@lynndeejohnson 8 жыл бұрын
Great step by step. Thanks a lot.
@dataschool
@dataschool 8 жыл бұрын
+Lynn Dee Johnson You're welcome!
@zhaoyangchen4307
@zhaoyangchen4307 Жыл бұрын
Thanks so much for your detailed instruction!
@dataschool
@dataschool Жыл бұрын
You're welcome!
@user-cw8si8zn5p
@user-cw8si8zn5p 9 жыл бұрын
Thanks!!! This series is really a lifesaver!!!
@dataschool
@dataschool 9 жыл бұрын
You're very welcome!! Are you a student in the Data Scientist's Toolbox course?
@user-cw8si8zn5p
@user-cw8si8zn5p 9 жыл бұрын
yes. and I've been struggling till I found your link, haha
@dataschool
@dataschool 9 жыл бұрын
I'm happy to help! :)
@saurabh_ritu
@saurabh_ritu 4 жыл бұрын
Thanks! Very much, Now I can get my repo updated.
@dataschool
@dataschool 4 жыл бұрын
Great!
@evalewis-fuller5510
@evalewis-fuller5510 9 жыл бұрын
Hello Kevin, Thanks for your help. I am still trying to understand the Git and GitHub operations. Your lectures is helping me become more familiar with the subject the software of which I will have to set up and then practice the commands. ELF
@dataschool
@dataschool 9 жыл бұрын
Eva Lewis-Fuller You are very welcome, I'm happy to help!
@Concerned_Indianz
@Concerned_Indianz 2 жыл бұрын
Wonderful, simple and stright forward,,,You forced me to subscribe.
@dataschool
@dataschool 2 жыл бұрын
Thanks!
@keepitsimple3645
@keepitsimple3645 2 жыл бұрын
thanks very much... your video was perfectly explained and helped alot
@dataschool
@dataschool 2 жыл бұрын
You’re welcome!
@AmitKumar-vm6te
@AmitKumar-vm6te 9 жыл бұрын
You saved lot of my time . Thank you Kevin
@dataschool
@dataschool 9 жыл бұрын
Amit Kumar you are very welcome!
@EmmanuelESulai-bk8ch
@EmmanuelESulai-bk8ch 3 жыл бұрын
You jjust saved a life. Thanks for sharing this video
@dataschool
@dataschool 3 жыл бұрын
Glad it helped! 🙌
@RodneyGurdal
@RodneyGurdal 8 жыл бұрын
I struggled for HOURS trying to find a solution for this! THANK YOU! One weird thing: after I did the pull, I got a new screen in GitBash saying I had to write a commit message saying why I needed to this. The problem was, there was no apparent way to submit (typing the command and hitting enter did nothing) and no way to exit. I eventually just shut down Bash and restarted. The README file was there.
@jettyabraham1564
@jettyabraham1564 8 жыл бұрын
Try this website on advice on what to do:stackoverflow.com/questions/14046122/github-locks-up-mac-terminal-when-using-pull-command
@user-bo5cz2ec6s
@user-bo5cz2ec6s 8 жыл бұрын
Same problem.
@dataschool
@dataschool 8 жыл бұрын
+Rodney Gurdal Philip is correct: You were in the text editor Vim, and you just have to know how to save and exit. It's quite confusing, the first time you see it!
@marveltv5341
@marveltv5341 5 жыл бұрын
@@jettyabraham1564 ya that solve my problem.. after following stack overflow type git push origin master and it solved my problem
@desisto007
@desisto007 9 жыл бұрын
thank you for sharing!
@harshendubhardwaj5283
@harshendubhardwaj5283 8 жыл бұрын
Great videos for starters, thank you
@dataschool
@dataschool 8 жыл бұрын
+H1B1 You're very welcome!
@Rasbin2010
@Rasbin2010 8 жыл бұрын
+Data School , Thank you so much. This was exactly the error I was troubled by.
@dataschool
@dataschool 8 жыл бұрын
+rasbin rijal You're welcome! That's why I made this video :)
@eskimobear5884
@eskimobear5884 9 жыл бұрын
Thanks so much!!! This completely solved my problem :)
@dataschool
@dataschool 9 жыл бұрын
Eskimo Bear You're welcome! Glad to hear :)
@sayanroy6265
@sayanroy6265 2 жыл бұрын
Old but gold♥
@dataschool
@dataschool 2 жыл бұрын
Thank you!
@jonah5908
@jonah5908 4 жыл бұрын
Great video!
@dataschool
@dataschool 4 жыл бұрын
Thanks!
@rameshnalli7510
@rameshnalli7510 6 жыл бұрын
Great work --Thank you so much
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@LGmediaGlobal
@LGmediaGlobal 3 жыл бұрын
Thank you for this!
@dataschool
@dataschool 3 жыл бұрын
My pleasure!
@reckonroy7987
@reckonroy7987 5 жыл бұрын
Thank you. This helped a lot
@dataschool
@dataschool 5 жыл бұрын
You're very welcome!
@PedroHenrique-gj4ik
@PedroHenrique-gj4ik 2 жыл бұрын
Very good. Thanks!
@dataschool
@dataschool 2 жыл бұрын
You're welcome!
@AlxZeroXChronicles
@AlxZeroXChronicles 4 жыл бұрын
excelente video me ayudo bastante
@dataschool
@dataschool 4 жыл бұрын
Thank you!
@elson4352
@elson4352 3 жыл бұрын
This one help me! Thank you,
@dataschool
@dataschool 3 жыл бұрын
Glad it helped!
@pwcriswell
@pwcriswell 10 жыл бұрын
Nice job! Very helpful. Had to get past some setup errors I think I made first.
@dataschool
@dataschool 10 жыл бұрын
Great to hear that it was helpful to you!
@RoyAndrada
@RoyAndrada 3 жыл бұрын
this is still ok in 2020. thanks man.
@dataschool
@dataschool 3 жыл бұрын
You're welcome!
@adityarajkarne6363
@adityarajkarne6363 10 жыл бұрын
Thanks a lot!
@ChanceMinus
@ChanceMinus 4 жыл бұрын
Thank you.
@sakshamgoel8950
@sakshamgoel8950 4 жыл бұрын
Good help :)
@anishhui192
@anishhui192 4 жыл бұрын
thank you very much!!!
@dataschool
@dataschool 4 жыл бұрын
You're welcome!
@erichepperlewp
@erichepperlewp 5 жыл бұрын
Good tutorial! The cloning method worked for me in 2019, except I also had to run "git pull origin master --allow-unrelated-histories" to resolve the "fatal: refusing to merge unrelated histories " error.
@dataschool
@dataschool 5 жыл бұрын
Interesting! Good to know, thanks for sharing!
@asavarideokar511
@asavarideokar511 9 жыл бұрын
Thank you very much Kevin!!It's a great video and it solved my course project part 3 problem. :) Just one more question : whenever I use 'git push' command git asks for username and password.So how can I configure git so that it won't ask for username and password on each 'git push'.(on Windows)
@laIlI129
@laIlI129 5 жыл бұрын
Very helpful
@dataschool
@dataschool 5 жыл бұрын
Thanks!
@violaoamador
@violaoamador 5 жыл бұрын
man you save me!! thanks so much!
@dataschool
@dataschool 5 жыл бұрын
You're very welcome!
@sabbirahmmed7161
@sabbirahmmed7161 3 жыл бұрын
thank you , now I understand my problem
@dataschool
@dataschool 3 жыл бұрын
Great!
@lenardsimmons4771
@lenardsimmons4771 7 жыл бұрын
Thank you, it works
@dataschool
@dataschool 7 жыл бұрын
Great!
@woodrowwilson307
@woodrowwilson307 8 жыл бұрын
I LOVE YOU!!!
@dataschool
@dataschool 8 жыл бұрын
+Woodrow Wilson Ha! :)
@isabelshan
@isabelshan 9 жыл бұрын
Great video! Solved my problem exactly. Just one follow up question: What is the difference btw add command and commit command? Do you need to do them both every time?
@dataschool
@dataschool 9 жыл бұрын
isabelshan Great question. If you make a change in your repository (add/delete/modify a file), Git will be aware of the change, but the change will not automatically be recorded in the Git history. "Adding" is how you tell Git "I want you to keep track of that particular change I made", and "committing" is how you tell Git "permanently record the changes that I have added". The whole point of Git is to commit changes so that you can keep track of what changed, but what gets committed in limited to what changes you have added. Does that help?
@nh7788
@nh7788 2 жыл бұрын
Thanks man.
@dataschool
@dataschool 2 жыл бұрын
Happy to help!
@santiagozarpado1145
@santiagozarpado1145 3 жыл бұрын
great thanks!!!!
@dataschool
@dataschool 3 жыл бұрын
You're welcome!
@diwaspoudel7
@diwaspoudel7 6 жыл бұрын
Yes its great. Now I have done....Thanx
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@kimjason6824
@kimjason6824 9 жыл бұрын
when i type git pull origin I get There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master What should I do please help
@tuanku4380
@tuanku4380 6 жыл бұрын
Thanks you so much
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@junarjacob9858
@junarjacob9858 4 жыл бұрын
nice you fix my problem
@dataschool
@dataschool 4 жыл бұрын
Great to hear!
@mrhunterf2869
@mrhunterf2869 5 жыл бұрын
Love that typing sound.
@dataschool
@dataschool 5 жыл бұрын
Thanks! Maybe? :)
@debanjanchakraborty6016
@debanjanchakraborty6016 Жыл бұрын
Thanks man.....
@dataschool
@dataschool Жыл бұрын
You're welcome!
@fxcencey
@fxcencey 6 жыл бұрын
so i should init and remote and then pull basically.. good to know
@agrpalwankhade7987
@agrpalwankhade7987 8 жыл бұрын
thanks to git and Data school
@dataschool
@dataschool 8 жыл бұрын
+Agrpal Wankhade You're welcome!
@poojacse27
@poojacse27 7 жыл бұрын
when i did pull origin master , it says "Fatal : refusing to merge unrelated histories" , i did the same exact steps mentioned by you.It will be very helpful if u Can tell me why this error is coming.
@andreiolegovich5971
@andreiolegovich5971 4 жыл бұрын
git pull --allow-unrelated-histories origin master
@abhilashasaini8758
@abhilashasaini8758 4 жыл бұрын
@@andreiolegovich5971 thanks man!
@andreiolegovich5971
@andreiolegovich5971 4 жыл бұрын
@@abhilashasaini8758 you are welcome!
@user-lp4qs9bn6g
@user-lp4qs9bn6g 3 жыл бұрын
@@andreiolegovich5971 thanks thanks thanks.....
@andreiolegovich5971
@andreiolegovich5971 3 жыл бұрын
@@user-lp4qs9bn6g you are welcome)
@ForestDewberry
@ForestDewberry 2 жыл бұрын
The suggestions to prevent the problem that you provided are only accurate if you're the only one pushing and pulling to and from the repo; i.e., it's not a collaborative project. I ran into this issue when another colleague pushed a commit to the repo, creating a new file that I didn't have on my local machine, and I attempted to push my code changes.
@dataschool
@dataschool 2 жыл бұрын
That's right, this video is only handling one common case, but not all possible cases.
@ForestDewberry
@ForestDewberry 2 жыл бұрын
@@dataschool That's fine, I'm adding my comment in the hopes that it will help someone else in my situation- your video will still be appreciated
@gerarddeib1513
@gerarddeib1513 9 жыл бұрын
Thank you for the help. I'm still having a problem: When I enter "git pull origin master" I get a message saying "Please enter a commit message to explain why the merge is necessary" (on mac)
@dataschool
@dataschool 9 жыл бұрын
Gerard Deib I believe that would only happen if you have local changes that are conflicting with the changes you are trying to pull down. Could you summarize what you have done up until now? I'm happy to try to help you troubleshoot further!
@user-te6pi6wc9o
@user-te6pi6wc9o 9 жыл бұрын
Had the same problem and stackoverflow helped a lot stackoverflow.com/questions/14095867/git-pull-cant-submit-merge-message
@dataschool
@dataschool 9 жыл бұрын
Thanks for the tip!
@XOblivion97
@XOblivion97 4 жыл бұрын
is there a way to clear those files that were initialized in the github console?
@dataschool
@dataschool 4 жыл бұрын
No, but you can pull them into your local repository.
@vijay17101991
@vijay17101991 9 жыл бұрын
Can you please tell what is the licence.md file and what is it used for? I found that while creating a repository I have a choice to choose different types of licence.
@dataschool
@dataschool 9 жыл бұрын
vijay krishn A license file defines how your code can be used by others. Here's a website that describes a few common license options: choosealicense.com/
@vijay17101991
@vijay17101991 9 жыл бұрын
Data School Thank you for the info.. :)
@ravindrababu639
@ravindrababu639 7 жыл бұрын
nice videos
@dataschool
@dataschool 7 жыл бұрын
Thanks!
@edwinacuna2577
@edwinacuna2577 9 жыл бұрын
Hi i am a newbie and i would like to know how do i add a local folder with pdfs and rmardown files to the local repo and the the github. I am struggling because i do not know how can i set up the directory in the local repo, for instance the path to my folder is C:\Users\Usuario\Google Drive\R\PortfolioT. I already created the github repo with the same name PortfolioT but i don not know i have have to give the following path mkdir ~/C:/Users/Usuario/Google Drive/R/PortfolioT
@dataschool
@dataschool 9 жыл бұрын
Hi Edwin Acuña, there are basically two ways you can do this. The first is to create a GitHub repo, clone it, add to it locally, and push back up to GitHub. The second way is to create a GitHub repo, create a local repo, pull from GitHub, add to the repo locally, and push back up to GitHub. If you watch my video series, you'll see the entire process! kzfaq.info/sun/PL5-da3qGB5IBLMp7LtN8Nc3Efd4hJq0kD
@ZhouHaibo
@ZhouHaibo 3 жыл бұрын
Be noted! Now `master` branch name has been changed to `main` in Github, that is a change effected from Oct.2020.
@dataschool
@dataschool 3 жыл бұрын
Thanks for sharing!
@sinsose
@sinsose 3 жыл бұрын
That's why you should run git checking -b main before commiting directly to main
@patrickeverman
@patrickeverman 9 жыл бұрын
**If you've already pushed changes (not a new repo) and are concerned check this** I had been able to add, commit, and push my local changes to Github without issue. *However: This issue addressed in this video occurred midway through completion of my coding. If anyone is concerned about their Remote files (in Github) perhaps overriding their Local changes they want to put.( i.e. "My CSS works now, if I pull then push, will the old CSS come through or will my site break from the pulled content?" ), you may find this S/O article about stash to be most helpful: stackoverflow.com/questions/19216411/how-do-i-pull-files-from-remote-without-overwriting-local-files Let me know if any of that information is misleading or incorrect!
@arecode3588
@arecode3588 8 жыл бұрын
What can i do to fix this issue after i type git push it says "ERROR: Repository not found. fatal: Could not read from remote repository."
@dataschool
@dataschool 8 жыл бұрын
+Nouveau départ Perhaps this will help? stackoverflow.com/questions/13509293/git-fatal-could-not-read-from-remote-repository
@arecode3588
@arecode3588 8 жыл бұрын
Thank you so much! This is my first time using git and i am super confused
@arunprasad4049
@arunprasad4049 5 жыл бұрын
thanks. i found the best way to be clone.
@dataschool
@dataschool 5 жыл бұрын
Great!
@manishdpsg
@manishdpsg 5 жыл бұрын
Could you show the same using GIT GUI ?
@dataschool
@dataschool 5 жыл бұрын
I've never used a GUI for Git, I'm sorry!
@ssebastianoo
@ssebastianoo 4 жыл бұрын
thanks! But sometimes I need to do "git pull origin master --allow-unrelated-histories".
@PROTECHRAHUL
@PROTECHRAHUL 2 жыл бұрын
Can not we push forcefully, without pulling etc
@dataschool
@dataschool 2 жыл бұрын
It's best to avoid force pushing unless you *really* know what you are doing and the consequences.
@bernadettebrogan3674
@bernadettebrogan3674 9 жыл бұрын
What is the purpose of the README file? What are the implications of creating a repo without a README file?
@dataschool
@dataschool 9 жыл бұрын
Bernadette Brogan Great question! The README file is just a GitHub convention. In the README file, the repo owner usually describes the purpose of the repo, along with any other information they think is relevant. It is not a required file, however if it is present, GitHub will automatically use it as the "home page" of the repo. Note that if a GitHub repo is completely empty, it can't be cloned, so sometimes people add a README file just so that it can be cloned. Hope that helps! You can learn more about it in this video: kzfaq.info/get/bejne/ma95aKyl0s-9dI0.html
@bernadettebrogan3674
@bernadettebrogan3674 9 жыл бұрын
Thanks for the info, this is helpful!
@dataschool
@dataschool 9 жыл бұрын
Bernadette Brogan You're very welcome!
@Ghaleon15
@Ghaleon15 9 жыл бұрын
I got an error on the command: git pull origin master. warnings: no commom commits Conflict (Add/Add): Merge conflict in My_Folder/My_File Automatic merge failed: fix conflicts and then commit the result
@dataschool
@dataschool 8 жыл бұрын
+Alan Naidon Sorry, it's difficult to give sound troubleshooting advice for Git without sitting at your computer!
@justinfok598
@justinfok598 3 жыл бұрын
After I pulled, it still gave me the error.
@libo8318
@libo8318 7 жыл бұрын
Hi I am stuck at the pull stage: $ git pull origin master The authenticity of host 'github.com (192.30.253.112)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
@dataschool
@dataschool 7 жыл бұрын
I'm sorry, it's hard for me to troubleshoot these issues for you remotely. Good luck!
@sandeepjain5776
@sandeepjain5776 4 жыл бұрын
thankyou so meri jaan.....
@dataschool
@dataschool 4 жыл бұрын
You're welcome!
@latzobear
@latzobear 7 жыл бұрын
git pull does not work. "refusing to merge unrelated histories."
@dataschool
@dataschool 7 жыл бұрын
I'm sorry, it's hard to troubleshoot git issues remotely because the solution depends on the exact state of the repository. Good luck!
@latzobear
@latzobear 7 жыл бұрын
i figured it out. thank you
@jaca4641
@jaca4641 7 жыл бұрын
what was the problem ? I have the same issue
@latzobear
@latzobear 7 жыл бұрын
are you still having this problem?
@latzobear
@latzobear 7 жыл бұрын
It happened because I tried to do pull request inside a file directory that already had files in it (hence the "unrelated histories"). the point is, in order to do a pull request, make sure the folder you're pulling into is completely empty *before you make the **first** pull request*. ex: if you have a folder on your desktop called "learningGit" which has 2 files in it, git will not allow you to do any pull requests. but if you have another folder called "learningGit1", which is completely empty, git will allow you to do a pull request. it's pretty odd, but that's how it works.
@GauravGupta-jg7he
@GauravGupta-jg7he 9 жыл бұрын
After following these videos when the command git push origin master is executed, it says " Unable to reach github.com/Username/Repo name" Can anyone provide me with a solution to this??
@dataschool
@dataschool 9 жыл бұрын
Gaurav Gupta Have you been able to connect to GitHub previously, or is this your first push? Is it possible for you to try a different computer?
@GauravGupta-jg7he
@GauravGupta-jg7he 9 жыл бұрын
finally i got the solution. ".gitconfig" file need to be edited bcz i am using proxy srerver. It was my first push.
@dataschool
@dataschool 9 жыл бұрын
Gaurav Gupta I'm glad to hear it worked out, congratulations!
@Zen-lz1hc
@Zen-lz1hc 2 жыл бұрын
LIKE Thank you, I was a little bit annoyed and frustrated with GitHub, I mean they could make this whole thing simpler, but they decided not to!
@dataschool
@dataschool 2 жыл бұрын
You’re welcome!
GitHub Basics Made Easy: A Fast Beginner's Tutorial!
23:30
Skill Foundry
Рет қаралды 73 М.
How to Push Eclipse Project into GitHub | Eclipse + Git errors not authorized
12:00
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 148 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 70 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 62 МЛН
Git and GitHub Tutorial for Beginners
46:19
Kevin Stratvert
Рет қаралды 1,2 МЛН
Git vs. GitHub: What's the difference?
10:06
IBM Technology
Рет қаралды 381 М.
1.6: Cloning Repo and Push/Pull - Git and GitHub for Poets
21:50
The Coding Train
Рет қаралды 482 М.
Learn Git Squash in 3 minutes // explained with live animations!
3:56
The Modern Coder
Рет қаралды 293 М.
How To Fix GitHub Push Rejected Errors + Explanation
2:25
LearnToCode - الدارجة المغربية
Рет қаралды 28 М.
So You Think You Know Git Part 2 - DevWorld 2024
23:02
GitButler
Рет қаралды 71 М.
What is GIT PUSH and How to Pushing Data to Remote Repositories
14:11
Git Fetch vs Git Pull? Which one should you choose?
3:09
Cameron McKenzie
Рет қаралды 38 М.
What is a MESSAGE QUEUE and Where is it used?
9:59
Gaurav Sen
Рет қаралды 952 М.
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 148 МЛН