Git and GitHub Tutorial || Git Architecture || Git Crash Course || Professional Git | Code Decode

preview_player
Показать описание
Git and GitHub Tutorial || Git Architecture || Git Crash Course || Professional Git (Things no one taught)
Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

This is a git tutorial for beginners/ github tutorial using git bash only. Hence it will enhance the knowledge of git commands as we will do all the operation used in git using git bash and git command manually.
There are many GUIs available but using commands will be the best way to learn git.

To learn git in professional way we need to learn git using git bash and git commands .
This git tutorial or git hub tutorial answers the most important interview questions as to what is git? what is github? how to use git bash? how to learn git ?
what is git rebase? what is git repository, git commit, git add , git branching , git merge vs git rebase ? , git merge, git push, git checkout which are most of the git basics.
git Merge vs Rebase is the very important interview question when version control systems comes into picture in git learning and git basics

***************************Commands Used***************

Git is a free and open source distributed version control system.
Generating a new SSH key and adding it to the ssh-agent using git bash

Step1 :
ssh-keygen -t rsa -b 4096 -C (gmail id)

Then u will press enter and at default location shown there: (/c/Users/XXX/.ssh/id_rsa)

start the ssh-agent in the background
$ eval $(ssh-agent -s)

Now add it to agent

ssh-add ~/.ssh/id_rsa

$ git init
With this command we will initialise local directory as git repository. Till now our code is in working area

$ git add . -- with dot
# Adds the files in the local repository and stages them for commit. These files are prepared to be commited. So now files are moved from working area to staging area

$ git status
to see ur files. In staged, unstaged or untracked status. After commiting u will not see the file here.

$ git commit -m "First commit"
# Commits your tracked changes on your local repository and prepares them to be pushed to a remote repository. So now files moves from stage to local repo.

add url for remote repository in which your local repo will be pushed .

git remote -v
Verify new remote url.

$ git push –u origin master
Pushes the changes in your local repository up to the remote repository you specified as the origin

Git and github tutorial for beginners that we cover here uses concept of forking created at github.
git commands will be same for forked one and for organisational level repositories.

For forked repos :

Go to your .config file in .git and check upstream and origin.

Upstream should be from where u can take pull. Means your main repo of organisation.

Origin must be your forked where you will push your code and raise a pull request so that on approval those changes can be merged to upstream branch or organisation.

git remote add upstream (url).

git remote add origin(url).

We have already seen:
Git init [repo name] : This command is used to start a new repository.
Git clone : used to obtain a repository from an existing URL into local repository.
Now:

Git add [file] - This command adds a file to the staging area.
Git add .(dot) - This command adds one or more to the staging area.

git diff: Show unstaged changes between your index and working directory.

git commit -m “[ Type in the commit message]”
Usage : git commit –am “my message”

git status : List which files are staged, unstaged, and untracked.

Git log : Display the entire commit history using the default format. For customization see additional options.

git push origin $branchname:$remote_branchname
like --- git push origin master

Git pull -) this command will pull changes from default remote repository which is origin n not upstream, if wanna pull from upstream then use command git pull upstream master.

git fetch: fetches the changes from remote repository but will not affect your local so will not give u any merge confict,
The interesting thing about the fetch command is that it doesn't actually affect anything in your local repo. No working changes will be lost, and you'll see no direct affect on your local branches. This is because Git keeps fetched content separate from your own repo's content until it is merged in.

git fetch (remote-repo)
$ git merge FETCH_HEAD

So obviously the big difference between fetch and pull is that pull actually performs a fetch in addition to a merge.

#git #github #gitandgithub
Рекомендации по теме
Комментарии
Автор

This is best explanation ever for git, deserves millions of views for your efforts. that flow chart explanation is amazing

surajgrandhi
Автор

34:44 Clone Forked repo
38:00 Intro to Pull Request
Add upstream via command
01:03:48 merge / rebase
01:10:39 pull / fetch from org repo (pull will make change in workstation)
01:12:55 Raise Merge PR request
01:15:00 Squash and Merge

gsaravanan
Автор

who the hell disliked the video. One of the best videos. Thank you mam. Thank you code Decode.

deepakjava
Автор

It is one of the best tutorials on Git and Github I have ever seen..!! Thank you so much

sushantjoshi
Автор

Awesome as usual!! Go Code Decode, Waiting for more such videos

vulligadlarohith
Автор

Nice Explanation of the terms used in Git and GitHub. Thanks to the trainer. It was a good video for Beginners and to all the professionals.

MadirajuKChaitanya
Автор

It's simply nice and superb. I watched no.of videos on git but this video gave me more knowledge and clarity on the way git & github works. And the way you are explaining about each thing is awesome and keep going this way. If you can make videos on cloud related concepts like AWS that will helpful for us to get knowledge on that. I really liked this video and your way of explanation.
Please do more videos and give us more knowledge and will together grow. Thank you....!

venkatesha
Автор

Articulation of content and presentation is very good. All the videos are very useful in interviews
Good job 👍

mazeedmahammad
Автор

You guys are awesome. Thank you team to provide such peerless nice content 👍🙏

ManishGupta-vtvc
Автор

Brilliant video to cover basics of Git... Thank you!

ninadkhire
Автор

Thankyou so much for this amazing video, keep posting such awesome content🙂🙂

ameyachital
Автор

Nicely you have covered the git topics. Your videos are coming up good where we get to learn from the beginning. Thanks to you for that. Coming back to this video, I think you forgot to show removing commit. Also, could you please go over git rebase if you can as you were planning to do it on another video. These will complete the git concept I guess.

ashaseetharamu
Автор

Simply superb can you make more videos like on docker jenkins ansible and kuberntes please

cmehtainfo
Автор

Very well explained. Thanks for providing such a great content.

Kuchbhitubers
Автор

make one video for advanced level, example git stash and merging code from the other repositories to current repository

lovebranch-hemavasanth
Автор

That was a very good explanation!!
~~Please make a video on how to resolve conflicts from the upstream branch. This question was asked to me in one of the interview~~

anuragmarotkar
Автор

Noone explain git better than this Thanks for this video

praveentripathi
Автор

thank you mam for making such a valuable video..

ajaygosavi
Автор

Good one...helpful. well explained. Thanks!

aadithyaks
Автор

This is awesome, thanks for covering operations commands in such wonderful video. This is very helpful, I will never forget your voice, what’s your name BTW? Don’t say code decode 😜

avinashm
welcome to shbcf.ru