How to commit changes to git in Intellij Idea | git commit

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to my channel i am razni khan and this is the continuation of intellij idea with git series right so in earlier video we have seen how to uh clone or how to take that uh project from remote repository to intellij idea right so if you have not seen that one i will give that link in the description section you can watch that video as well right so in today's video we'll see how we can commit changes to our repository and we'll push those changes to remote repository right so we'll explore in details right so let's open intellij idea first okay so here is this intelligent idea so already in last video we we have seen how to import this project from uh github right so in company you may they may assign a gitlab or sorry uh what is that bitbucket some repo and you can do the same way right so in today's section or today's video we're gonna see how we can commit changes right so first just see uh we need to uh we need to have this is it just see this is something uh terminal is there right so like this we need to take that uh vcs details or github uh what you can say this one some table or some kind of thing that one we need to uh we need to first put it here you can see my mouse cursor here so if you see here this search bar right so click this one and search get oh let's get not get it's a version control or something version control right let's see alt plus nine this is the version control uh this is a quick tab right so first you need to search from here version control quick tab right this quick tab will helps us to perform different kinds of operation right okay so uh first we need to change some file then we need to commit right so currently i am clicking this version control and if you see here some tapes are there local changes log these are the changes right so local changes and log these are the two tabs in log uh this log section i will explain later and this local changes so if you will change something uh in the file or if you are modified something those files will be appear here in this tab local changes right so for example ah this is load custom yml application.java right okay sdk is not defined let's set up this sdk ah java these are the default things i guess then okay so uh this thing is done right so uh let's change something here if you see system.out.println something is there i am copying this statement and putting over here right the see local changes this load custom yml application.application.java it appears over here right so anything any file you have changed it will appear over here in local changes this step right suppose if you want to see what are the changes local changes just click this local changes tab and you'll see all those files for example suppose yml reader controller right so here let me have some css out system dot out dot println right and let's give here controller okay let's see it's appear over here right yml readercontroller.java okay so this is this part is done so these are the local changes appear over here if you want to see what are the changes right a layer what is that what are the difference between before changes and after changes just right click that one and here if you see so diff right click that one and you can see what is the difference or what are the what changes you have done in your files right this way you can verify your send this as well this is pretty simple right click and sort if right so hope you got a clear picture uh where you will see all those change change files or whatever that files you have changed where you will gonna see all right so here and if you want to commit now we have change our files right now we will commit those files if you want to commit all those files just select like this all those files select and right click over here and commit right commit if you want to commit a single file just right click to that particular single file or select that particular single file and right click and commit right so let's commit both those both the files uh now and we're gonna see right click and commit commit means it will commit to your local repository right so let's have some commit messages idle in company that this commit message also some standards will be there right uh you need to have uh something like some uh story name or story uh story means use a story that task the task name then column then your number uh in company you will have some standard right commit message standard so whatever that story you have that story name or the story number or that issue number that is suppose i have uh issue um three four five six three four five six colon or that name suppose three four five six some name will be there us even i mean user story enhancement colon then commit message so an ideally some standards will be there in company if you are not following this standard then your commit uh you you will not you will not you will be not able to commit it will gonna fail right but this is not mandatory some companies uh have these standards right so let's have our compete message we do not have any standard uh less simple commenting example these are spellings um mmit right commit test commit okay let's push this test commit okay so simple here a lot of options are there like perform i mean reformat that code rearrange code optimize import right so before committing if you want to if you want to do these things or perform these things in your file then you can check these things as well pretty simple and again here also you can see uh those changes what are the changes in that file and in that commit uh window here in this window you can able to see what are those files you are going to commit and over here if you click here those changes you you can able to see if you want to see you'll be able to see those changes right like this right hope you got a clear idea now if you see here this commit uh what is this one this what is this button this commit button right simple hit this comment button and it will commit right if you want to commit and push just see this drop down commit and push so fast it will come in then automatically it will push right so this is one option commit and post at a time another way simple commit and later push right so first let's see this option commit and letter fast will commit and separately again we'll push this is one way or else directly commit and post is there right let's perform this one commit so commit over here okay once you have committed those changes will be removed from local changes right now it's now it's committed okay but in the repository it will not be able to reflect in repository it will not be able to reflect let's see it's four months ago these are these are committed right now if you want to commit how we'll gonna commit so here vcs so here vcs and com uh it's already we have committed right now we'll push so here uh git and here push or ctrl shift k also you can hit so let's push this push those changes so here force was also there for suppose it's disabled now so let's boost those changes okay the c is pushing those changes to our remote repository okay who's successful right origin master now let's see those changes over here oops why it's not able to reflect actually this is one minute ago if you see this commit this commit message test commit one minute ago right this file is got changed and here if you'll see those uh csr system.out.rental and right these are the changes recently we have done okay so hope you got a clear picture that how will gonna commit if you see here those comments you can see those comments as well test commit recently we have done two minutes ago right so hope you got a clear picture that how you will change those files in your intelligent idea and how will uh commit those changes and how we'll push those changes using intellij idea right those are pretty much simple and if you compare those uh command line uh command line uh or not those commands this is pretty simple you don't need to remember any command directly you can perform those operations right okay so in next video we will gonna see uh what adding new files and commit right so here in this video we have seen how to add uh changes to existing file and commit those existing file right so in next video we'll see how to add a new file and commit and post to that remote repository right hope you got a clear picture right then do have your valuable comments in the comment section which will keep motivated me to upload some more videos like these and hit a like to this uh tutorial if you are really like this like this one and yes if you are not subscribed yet my channel please do subscribe my channel as well right so thank you for watching
Info
Channel: Java Shastra
Views: 29,774
Rating: undefined out of 5
Keywords: How to install
Id: RfbV3IM93Mc
Channel Id: undefined
Length: 12min 50sec (770 seconds)
Published: Fri Mar 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.