Git Tutorial for Beginners: Command-Line Fundamentals

Sdílet
Vložit
  • čas přidán 5. 06. 2024
  • Git is the most popular version control system out there and for good reason. In this video, we'll go over the basics of what git is and how to use it within the command-line. There are several GUI tools out there to help you get started with git, but it can be extremely beneficial to learn git from the command-line as early as possible.
    Some of the images used in this video are from the "Pro Git" book. These are licensed under creative-commons. You can find the book at:
    git-scm.com/book/en/v2
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com/shop/coreyschafer
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Git

Komentáře • 1,6K

  • @Wiikend
    @Wiikend Před 6 lety +1323

    I would strongly advise to watch the whole video because it's a great source of information, but for those reviewing the content or looking for a specific concept, here's an overview:
    0:00 - Introduction
    1:31 - Distributed vs Central Version Control
    3:17 - Installing Git
    3:39 - First Time Setup
    6:36 - Getting Started (Local repository)
    10:41 - Git File Control
    14:55 - Getting Started (Remote repository)
    20:37 - Branching
    27:38 - Faster Example
    29:41 - Conclusion

    • @JR-yi5wb
      @JR-yi5wb Před 5 lety +1

      thanks for the timestamp!

    • @ilustrado7291
      @ilustrado7291 Před 5 lety

      Thank you, Adrian.

    • @Ste00I
      @Ste00I Před 5 lety

      Thank you!

    • @tetelim4428
      @tetelim4428 Před 5 lety +1

      Hi, how do u add those time-stamp links to your commit? Any doc?

    • @JoeTinnySpace
      @JoeTinnySpace Před 5 lety

      type it like usual@@tetelim4428

  • @loganinn3940
    @loganinn3940 Před 4 lety +144

    I watched this on May 12, 2020, and it's still the best video to learn how Git works.

  • @abhijeetbodas2001
    @abhijeetbodas2001 Před 4 lety +53

    With " learn X in Y minutes" kind of tutorials getting millions of views these days, its great to see this no-nonsense, content-first channel. Good job! Keep it up!

  • @Shubamakabra
    @Shubamakabra Před 6 lety +141

    Went into this a complete noob and came out 99% noob. Excellent video!!

    • @adamb3422
      @adamb3422 Před 4 lety

      magnus engø -(99% noob) **

    • @MrsCabecaderadio
      @MrsCabecaderadio Před 4 lety

      I feel the same! still a lot to learn but more hopeful

    • @MrsCabecaderadio
      @MrsCabecaderadio Před 4 lety +1

      @@swaraagsistla8641 he probably meant what he said. There is still a lot to learn and after watching the video I even think that 1% ain't that little...

  • @theemartinimike
    @theemartinimike Před 4 lety +76

    This was probably one of the most perfect tutorials of any technical subject that I have ever seen. So many tutorials make assumptions that they don't realise they are making and they skip things. This was perfect.

  • @idaho1002
    @idaho1002 Před 3 lety +4

    For beginners, this is the best git tutorial you’ll find in CZcams. Period.

  • @peterpetertorres
    @peterpetertorres Před 4 lety +4

    3+ years later this video is still super helpful. Thank you very much!

  • @suyashgupta1180
    @suyashgupta1180 Před 4 lety +7

    It has become a habit of mine to watch Corey's video in free time instead of Netflix.

  • @mjc01
    @mjc01 Před 7 lety +410

    Best tutorial I've seen so far and I've been poking around for them for days now. Thank you Corey.

  • @xyla37
    @xyla37 Před 4 lety +50

    I have to say, your videos are so useful and you have such a good way of explaining and teaching different concepts, subjects and how to's. I have watched and used quite a few of your videos, and found them so helpful and educational. This channel is such a great resource for anyone trying learn more about any of the subjects you have videos about. Thank you for being such an educator and lifesaver!

  • @swingymcswing
    @swingymcswing Před 4 lety +21

    I know it's been several years since these Git videos came out but I wanted to thank you for them, as they have made a big impact on my comfort level with Git for day-to-day development work in my team. I'm not afraid of Git anymore and I can use it with confidence. Great examples and your clear speaking voice made the material accessible for me. Thanks a bunch, Corey!!

  • @kywylabs147
    @kywylabs147 Před 4 lety +689

    The Odin Project brought me here :)

    • @andydelange9588
      @andydelange9588 Před 4 lety +17

      Yep, its been an awesome website so far.

    • @chan7191
      @chan7191 Před 4 lety +8

      samee :D hows your journey with TOP been?

    • @andydelange9588
      @andydelange9588 Před 4 lety +8

      @@chan7191 I'm using freecodecamp at the moment, Ill carry on with the Odin project, when I have a better foot into things.

    • @chan7191
      @chan7191 Před 4 lety +4

      Andrew De Lange thats great! Have fun :)

    • @helloworld-vq9gq
      @helloworld-vq9gq Před 4 lety +4

      @@chan7191 AWESOME

  • @LizardanNet
    @LizardanNet Před 8 lety +40

    Best Git tutorial video I've seen. Thanks!

  • @Rhythm-Of-Life
    @Rhythm-Of-Life Před 5 lety +29

    This is the Best tutorial I've seen so far on Git.... Thank you !

    • @sali313
      @sali313 Před 3 lety

      exactly, i have seen tons of videos on youtube but none of them explained as good as this channel

  • @hamzahahmad1670
    @hamzahahmad1670 Před 4 lety +1

    4 years later and this is still the best youtube video on the topic. Thank you

  • @moloko121212
    @moloko121212 Před 4 lety +4

    Best I have seen so far about git. Short and clean samples. Simultaneously I followed your steps and did on my own, and that is what I recommend to understand how that works. Don't only watch, instead watch and try on your own. Thank you Corey!

  • @donovanjames8656
    @donovanjames8656 Před 5 lety +19

    This video completely saved me for the git section of my class. You are the man Corey. Keep em coming.

  • @raghuvarapadma2040
    @raghuvarapadma2040 Před 4 lety +7

    Been viewing a lot of Git Tutorials lately, but this one is the best by far! Highly recommend for complete beginners!

  • @luvaholic
    @luvaholic Před 5 lety +1

    There are many tutorials out there but it's hard to find one that's to the point, relevant and easy to understand without too many frills and gimmicks. Well done.

  • @joshkindhart8059
    @joshkindhart8059 Před 5 lety +4

    Thanks again Corey! This video was very helpful! There was a lot of information thrown out in this video. I was feeling overwhelmed at first, but after taking a break and giving my mind time to rest and absorb what I saw, I rewatched the video again and this time everything clicked! So for the viewers that watch this video, I would recommend watch it once, then take a break and rewatch it until it sinks in. This is a very valuable and powerful lesson.

  • @soheilsoltani713
    @soheilsoltani713 Před 5 lety +7

    No one before had explained me in a so clear and straightforward way what git is and how it works. Many thanks Corey, you're a great teacher. Your videos on Python have also been very useful for me, and I just hope you add some C++ tutorials too :) Thanks again!

  • @MinhNguyen-dy4lo
    @MinhNguyen-dy4lo Před 6 lety +4

    Such a nice and comprehensible tutorial. I've struggled quite a lot to understand how to use git. Thank you so much for your effort, Corey! :)

  • @ilustrado7291
    @ilustrado7291 Před 5 lety +1

    Among the other CZcams videos in coding (series tutorials in particular), I found your content more engaging yet straight to the point. Your voice is also soothing and easy to follow; Like when I was watching your Python tutorials, I can anticipate what you "will do" next and then makes me feel like I actually "get it". That is a form of talent - the kind of empathy a great teacher has!

  • @paragbhalerao
    @paragbhalerao Před 2 lety +2

    As someone just entering the field of data engineering and version control being so new to me, this was, hands down the best video to explain the concepts. I tried reading some documentation online and watching other videos. But this was the easiest to digest. Thank you so much for putting this together. God bless!

  • @Badanoia
    @Badanoia Před 5 lety +3

    Hello Corey, your tutorial is great! I have asked friends how to work with git and taken other tutorials, but this is by far the best I took! Thanks a lot.

  • @sudarsandm
    @sudarsandm Před 6 lety +3

    GIt on fast track. Watching your videos == reading 2 to 3 books. Thank you Corey.

  • @dragonfly-7
    @dragonfly-7 Před 6 lety +2

    Here I'm repeating what I stated at the end of this series of videos: Corey, this series is awesome. It is a great stepstone into this topic ! The examples you had been chosing are of a very great value !

  • @NobixLee
    @NobixLee Před 5 měsíci

    This guy is a legend, a video that is 8 years old is the the best at clarifying git and GitHub

  • @bhavyasharma9565
    @bhavyasharma9565 Před 5 lety +3

    Extremely well made and detailed video! it explains all the basics of Git in a very simple and easily understandable manner. Thank you Corey!

  • @CodingCommanders
    @CodingCommanders Před 6 lety +65

    Best git intro I've seen!

  • @ManpreetKaur-ve5gw
    @ManpreetKaur-ve5gw Před 3 lety

    By far, the best tutorial on GIT. It's been months I've been trying to wrap my head around commands. This is the perfect tutorial to get anyone started.

  • @muralikpagolu
    @muralikpagolu Před 6 lety +2

    Got to say, you are a natural teacher. Very nice explanations, good pace, engaging and easy to follow. One of the best tutorials available on youtube!! Thank you so much :)

  • @binoydeka3987
    @binoydeka3987 Před 8 lety +28

    Best Video in simplified form. Please keep posting simple but powerful videos. This video shows that no. of views doesn't define the goodness of a video.

    • @coreyms
      @coreyms  Před 8 lety +1

      +binoy deka Thank you for the kind words!

  • @enockomondi6588
    @enockomondi6588 Před 4 lety +3

    The 30 minutes video has build my confidence in working with Git. Thanks alot for this

  • @BaljeetSingh-wq5yf
    @BaljeetSingh-wq5yf Před 2 lety +1

    Corey Schafer is best at choosing what is essential for viewer, i think this is the best content

  • @kunalchanda4854
    @kunalchanda4854 Před 5 lety +4

    Excellent to the point lecture. I recommend everyone this video as it covers all the necessary git commands with great explanation. Thank you so much.

  • @schriker17
    @schriker17 Před 4 lety +4

    That is the best git video serires on CZcams still in 2019! Great work, thank you so much!

  • @huydong8774
    @huydong8774 Před 5 lety +5

    Thank man, you 're the best instructor in my whole life :)

  • @dineshdg87
    @dineshdg87 Před 5 lety +1

    Best video in youtube to get a good understanding of all the necessary GIT commands. Clear and crisp explanation, Great job.

  • @konarkmodi3799
    @konarkmodi3799 Před 5 lety +1

    Thank you so much Corey for putting it all in simple words with proper practical understanding. Highly appreciate you take time in explaining technology and its tools to new bees like me.

  • @BrandonsOnline
    @BrandonsOnline Před 5 lety +3

    I have tons of knowledge when it comes to SVN, so how you presented this video to help me transition was beautiful. Well done, great presentation don't change a thing.

  • @jonathanvanheijzen365
    @jonathanvanheijzen365 Před 5 lety +6

    Spent 3 months trying to get git installed properly and ended up giving up. Watched this 30 minute tutorial and now it is set up properly. Who knew?

  • @jehushaphat
    @jehushaphat Před 2 lety +1

    You're very thorough in your tutorials! Some of the other CZcams tutors ignore certain crucial aspects in their explanations and leave viewers hanging, seemingly forgetting that they're mostly dealing with beginners.

  • @thingsiplay
    @thingsiplay Před rokem

    I decided to learn a bit more than the most basic operations in Git. And I am so glad that you covered this topic, as you never let me down. Thank you for doing these tutorials.

  • @Thughes78
    @Thughes78 Před 3 lety +35

    The Odin Project brought me here and as an actual NOOB, I am totally lost.

    • @marymad4203
      @marymad4203 Před 3 lety +2

      You are lost in which part? You wanna help?

    • @marymad4203
      @marymad4203 Před 3 lety +1

      I'm from The Odin Project and I'm learning Git for the first time too

    • @andikanakpan8436
      @andikanakpan8436 Před 3 lety +1

      @@marymad4203 me too, i got so lost, i cant seem to find the .gitignore or after touching it, also hard to follow the steps without actually doing it as he speaks

    • @marymad4203
      @marymad4203 Před 3 lety

      @@andikanakpan8436 I know, it happens sometimes, is normal. You can focus on git init, clone, status, add and commit for now, just to familiarize with git workflow. And the others commands you can learn after you learn these above. I hope it helps you :)

    • @JulianPotts3396
      @JulianPotts3396 Před 3 lety

      Im stuck on this part as well. Would anyone like to connect on discord and work together?

  • @sambhavdutt
    @sambhavdutt Před 7 lety +11

    Thanks a million ! This was very detailed.

  • @rameshn6721
    @rameshn6721 Před rokem +1

    I really like the narrative and depth of the details. For a beginner, this is much advanced and very clear. Thanks Corey.

  • @trapezoidxXx
    @trapezoidxXx Před 5 lety +1

    This is the most informative git tutorial I've watched so far! Thanks Corey.

  • @haluskua1947
    @haluskua1947 Před 5 lety +13

    Just want to say that you are the man!!

  • @bentrally
    @bentrally Před 5 lety +4

    If our tutor shows us this in class instead of trying to explain it himself this would be so much easier

  • @tomsummers5924
    @tomsummers5924 Před 5 lety +1

    Without question, the very best explanation and demo of command-line git that I've ever seen. I know that there are a lot more areas that are not covered here but, for a guy that's been in tech for over 20 years and is just learning how git works, this is fantastic! It's funny that everyone assumes that you know all about git and github. But if you don't, it can be confusing and exasperating. This tutorial is great!

  • @alextamarit5381
    @alextamarit5381 Před 3 lety +1

    Much appreciated for the effort compiling this easy to follow (yet comprehensive) tutorial.

  • @kieranwoodward8181
    @kieranwoodward8181 Před 6 lety +9

    This is the best tutorial for Git. Good job! +1 sub

  • @donaldhillis2722
    @donaldhillis2722 Před 4 lety +3

    Great Video. I'm studying a paper on Software Engineering and Design and this video on GIT was more educational and of higher quality than 2 x 1 hour university lectures on the same topic. Thanks

  • @umasankar2602
    @umasankar2602 Před 4 lety +2

    Mr.Corey Schafer the way you teach and your voice always motivates me to learn python and keep moving. Thank you very much for all your content

  • @vijaysamanthapuri2303
    @vijaysamanthapuri2303 Před 6 lety +1

    Perfect video to get started with Git. You have covered a lot in 30 minutes. Thank you very much for sharing your knowledge.

  • @mostroenturno9150
    @mostroenturno9150 Před 3 lety +18

    Odin Project brought me here. Even 5 years this video is still relevant and game changer for git noobs like me. Thanks for sharing your expertise.
    Ps: What's the service you are using to show slides? Is it selfhosted?

  • @csingh1982
    @csingh1982 Před 8 lety +6

    Very nice video, nice and simple to understand example. excellent job.. keep posting such videos..

  • @namecoelho2
    @namecoelho2 Před 5 lety +2

    This is a great tutorial video, the best Git one I ever saw. Congrats to you Corey! I could finally understand what I was doing wrong

  • @kedarpandhare8522
    @kedarpandhare8522 Před 6 lety +1

    Excellent tutorial. Cleared out most of my doubts regarding Git. Thank you for creating such an awesome tutorial.

  • @ashf8960
    @ashf8960 Před 5 lety +3

    Great voice for being an instructor

  • @scientistga
    @scientistga Před 7 lety +10

    Many thanks for your help and time. This is a great tutorial. Good job!

  • @vatssv3006
    @vatssv3006 Před 3 lety

    When I was looking for some tutorials on Git I didn't have to think twice before opening this video. That's where the quality of your tutorials are! Love your tuts!

  • @learneverything3383
    @learneverything3383 Před 5 lety +1

    I would be thankful to you , I entered the programming world by watching your video and I am improving day by day ,I am very much thankful to you.I have recommended your video to all my friends and they are enjoying your content.Thanks Corey

  • @Blowyourspot747
    @Blowyourspot747 Před 7 lety +6

    Wow!!! I love this guy! Please be my professor.

  • @BharatSingh-zk8lx
    @BharatSingh-zk8lx Před 5 lety +7

    I usually don't comment but THIS IS JUST AMAZINGGGGGGGGGGGGGGGGGG Tutorial. THANKS A LOT....................

  • @ratonmagico
    @ratonmagico Před 5 lety +1

    I always come back to your tutorials. You're the man, bro.

  • @hexemeister
    @hexemeister Před 6 lety +2

    Awesome! Best intro video on git ever! Loved mainly the workflow part!

  • @LegitimateContent
    @LegitimateContent Před rokem +3

    Best git tutorial on the Internet

  • @drezell47
    @drezell47 Před 8 lety +3

    Excellent tutorial!

  • @abilashr1958
    @abilashr1958 Před 6 lety +1

    Amazing GIT intro, This is one of the best videos. Thank you so much Corey.

  • @ulfsjodin7872
    @ulfsjodin7872 Před 6 lety

    There are "before and after" Coreys tutorials.
    Before one may be confused or stuck with a problem.
    After things make sense again and the problems get solutions.
    Just simply the best tutorials around.

  • @alexradu1921
    @alexradu1921 Před 3 lety +32

    So I've taken some notes for the last "fast example" of the video (the one that concludes all the commands). So, here is the workflow you will repeat forever from now on:
    git config --global user.name
    git config --global user.email
    git clone
    git branch my_new_branch
    git checkout my_new_branch
    (make changes to the code)
    git status
    git commit -m "Add @function in file7"
    git push -u origin my_new_branch
    (wait for unit tests to complete)
    (if all unit tests pass, then do these)
    git checkout master
    git pull origin master
    git merge my_new_branch
    git push origin master
    (now time to delete my_new_branch)
    git branch -d my_new_branch
    git branch -a
    git push origin --delete my_new_branch

  • @VincentDania
    @VincentDania Před 5 lety +3

    Got here from The Odin Project. Thanks TOP

  • @jasonavina8135
    @jasonavina8135 Před 2 lety

    i've been looking all over the internet for a great git command line tutorial and it was nowhere to be found on the git website or its linked videos, but i most certainly did find it here. THANKYOU. BEST, EASIEST TO UNDERSTAND GIT CL TUTORIAL ON THE WEB. Why is it so hard to find people who explain programming in regular words like you do? This is so useful.

  • @koustavchanda3843
    @koustavchanda3843 Před 5 lety +1

    The best video tutoial on Git Command line on youtube. Great teaching. thank you Corey :)

  • @s.akhtarjoomun263
    @s.akhtarjoomun263 Před 3 lety +4

    My brain is so slow that I had to watch your video on 0.75 speed to fully grasp what you were saying.

  • @frajaesdi
    @frajaesdi Před 4 lety +3

    Thank you from Colombia, the odin project has sent me here :)

  • @hshlom
    @hshlom Před 3 lety

    Super video. There's so much, I had to watch it numerous times, stopping and starting while taking notes.
    The most useful thing is that you show the sequence of commands needed to perform a function.

  • @scottwilliams3498
    @scottwilliams3498 Před 3 lety

    I rarely, RARELY, comment on videos; even ones I enjoy. But this tutorial has made the git workflow so easy to understand that I have to let Corey know how much I appreciate him putting this together. Thanks again!

  • @salimuddinkhan9349
    @salimuddinkhan9349 Před 5 lety +3

    very well explained...thank you :)

  • @ak8217220
    @ak8217220 Před 7 lety +9

    This is one great rich content tutorial you made!!!! (Y) Thanks aloooot!!! :D

  • @JoelByrd1
    @JoelByrd1 Před 4 lety +1

    Best Git basics tutorial I've been able to find online (video or text).

  • @carlosavila4290
    @carlosavila4290 Před 5 lety +1

    Undoubtely best Git video out there, very clear and straight to the point. Thank you so much.

  • @congcongkx
    @congcongkx Před 8 lety +7

    Hi Corey, can we skip pushing branch to remote if we don't intend to share it with the others?

  • @shamanthakrishnakg1978
    @shamanthakrishnakg1978 Před 5 lety +3

    I can't resist myself from paying the fees(this is not donating because you are the donor Corey!!).Thank you very much.

  • @andreasjanzen8823
    @andreasjanzen8823 Před 3 lety

    I have read and watched some material on git already, but this was the first time, the stageing process was explained properly. Thanks!

  • @gwanghyeongim768
    @gwanghyeongim768 Před 4 lety +2

    I'm thrilled to learn git tutorials! Thank you Corey for great vids.

  • @martinlutherkingjr.5582
    @martinlutherkingjr.5582 Před 4 lety +10

    6:04 How did you get out of/clear the user manual from terminal? Answer: press "q".

  • @gregtuve1109
    @gregtuve1109 Před 4 lety +3

    Wow. This is so abstract from the perspective of a rookie, and yet, so clear. Why? Corey uses the simplest possible examples at every step, has code ready to change, makes the simplest possible changes, explains everything he is doing, often before he does it and again after he does it. He does not race through everything, hoping to show us how fast or easy some system is or how clever he is. It's so clear, I was able to deduce some properties of git that he didn't even tackle in his exposition. I absolutely agree with Adrian Wilk: Go through the entire video even if you plan to work with git only locally. No matter what you're doing, take the time to study every video CS makes that has any bearing on your goals. NOBODY DOES IT BETTER. Theres no FOO or BAR here. Instead he names the remote repository "origin" to clarify git's checkout and push commands, showing file changes at every step with appropriate commands. Most of the explanatory video on the web is too basic for me now. Why? BECAUSE OF COREY SHAFER. Good morning Corey! I sure could use a video on using slightly advanced query objects in Django to work with related tables. I'm raising your monthly stipend 50%.

  • @prashanth9401
    @prashanth9401 Před 4 lety +1

    Dude, to be honest this is the best video that explained the concepts very clearly. I was having hard time to understand the git and how to work with it. But this tutorial made things clear for me. Thanks a lot for this.

  • @masepehr3593
    @masepehr3593 Před 4 lety +1

    You know what ? whenever i want to learn something in shortest time but highest quality, i search it in your channel !

  • @AlexSmith-ov4pt
    @AlexSmith-ov4pt Před 3 lety +46

    I think I've officially hit the "wtf is going on" part of learning... Not sure I'm even learning anything, honestly.

    • @alenjose3903
      @alenjose3903 Před 3 lety +4

      same here

    • @imbloodbath9908
      @imbloodbath9908 Před 3 lety +2

      me 2

    • @alenjose3903
      @alenjose3903 Před 3 lety

      Mash house ya that wud be great. Git makes no sense to me

    • @MrCmon113
      @MrCmon113 Před 3 lety +4

      Likely because you guys haven't stumbled into the problems git solves.

    • @ConsuelaPlaysRS
      @ConsuelaPlaysRS Před 3 lety +7

      Sorry you feel this way! Learning this stuff, as with anything you're learning for the first time, can be frustrating. Hope me offering some advice isn't seen as presumptuous on my part. In the wild, git is used primarily on teams collaborating on code, but you can use it on your own personal projects to keep track of changes. If I were you, I'd try to start a small project - just something with a few lines of code - and then head over to GitHub. From there, create an account, set up a repository, and commit your code to that repository. Of course, you need to initialize your local repository and "connect" it to the remote one you've set up on GitHub as well. This tutorial gives you most of the tools to do that, but you'll also probably need to Google around a bit.

  • @TinkCSA
    @TinkCSA Před 6 lety +4

    fk it! Time to binge watch you entire channel.
    Hope you become a prof someday... those are some pretty great teaching skills you got there

  • @ramsunku3900
    @ramsunku3900 Před 3 lety +1

    Just amazing . May be I am falling in love with your way of teaching . I thought I have learned these basics in bits and pieces with the stackoverflow e.t.c but no I learned them after seeing this video . You're the best Corey . You fail to disappoint the beginners like me :)

  • @taijeronv
    @taijeronv Před 5 lety +1

    Thank you for this series on git. Easy to follow, especially for beginners, and it works.

  • @alvisebaggio2380
    @alvisebaggio2380 Před 4 lety +8

    I get an error when I push my cloned repository ...
    remote: error: refusing to update checked out branch: refs/heads/master
    remote: error: By default, updating the current branch in a non-bare repository
    remote: is denied, because it will make the index and work tree inconsistent
    remote: with what you pushed, and will require 'git reset --hard' to match
    remote: the work tree to HEAD.
    remote:
    remote: You can set the 'receive.denyCurrentBranch' configuration variable
    remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
    remote: its current branch; however, this is not recommended unless you
    remote: arranged to update its work tree to match what you pushed in some
    remote: other way.
    remote:
    remote: To squelch this message and still keep the default behaviour, set
    remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
    To /home/alvise/clone1/../Git_test
    ! [remote rejected] master -> master (branch is currently checked out)
    error: failed to push some refs to '/home/alvise/clone1/../Git_test'
    Any idea?
    I even try git reset --hard
    Thanks a lot.....
    By the way awesome video...

    • @GuyMeiriPieQ
      @GuyMeiriPieQ Před 4 lety

      I got the same error too

    • @KkrDs97
      @KkrDs97 Před 4 lety

      i got the same and could not resolve

    • @ericmohler5609
      @ericmohler5609 Před 4 lety

      I'm guessing but it might be an artifact that for the sake of this tutorial we were messing with master branch on both the remote repo and and the clone repo. In general this is not good practice. Branching is a beast unto itself.
      This did the trick for me:
      "git config receive.denyCurrentBranch ignore" (case sensitive).

  • @rohanjain5103
    @rohanjain5103 Před 8 lety +3

    5:19 - git config -list

  • @tigerfanxiao
    @tigerfanxiao Před 2 lety

    I have seen a lot of git tutorials. But only this one is the best with the real workflow. Thank you a lot. I hope there is some new video from you.

  • @marco.nascimento
    @marco.nascimento Před 5 lety +1

    Great playlist, just started learning git and your lessons are really helpful!