how to create git repository and push to gitlab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends in this video we are going to see how you can create a git repository and how you can push your code or upload your code to your git repository so first of all what you have to do is log into your git lab account or github account whatever it is so for now i'm going to log into my gitlab account so i'm going to search for this gitlab login and then i'm going to click on the second link that is sign in then it will show me my username and password which is already saved in my computer so i'm going to sign into my account so this is my gitlab account so to create a new repository what you have to do is click on this new project button so i'm clicking on that so after that you will see these four options i'm going to go for this first option that is create applying project so i'm going to click on that and then it will ask me some information that is the name of the project i'm going to give it as testproject123 and it will generate a project url here and then you can give some project description that is i'm going to give it as this is a test project then you can see what is your deployment target so for now we don't we are not planning to deploy so we will see select this last option that is no deployment planned or if you are planning to deploy your project anywhere like on kubernetes hiroku or something else you can select those options but for now i'm going to go for no deployment plan so in this option that is visibility label there are two options private and public if you want to keep your project private then you can go for private and if you want to keep your project public that is access to anyone without any authentication then you can go for public and in the case of private you have to give the permission explicitly that is by it will be accessible to those only who you have given the permission to so i'm going to keep it as private only and then the fourth option is project configuration that is initialized repository with read me and this enables starting application security testing so i'm not going to uh needing both of these so i'm going to untick this and then i'm going to create a project so you will see that this project is created you will see project test project 123 was successfully created and then you will see these kind of options these kind of commands in your project so now our remote repository is created that is our kit repository is created so what you have to do now is you have to create a local repository so i have created this local repository that is a folder and in that i am going to create my project folder that is project so inside this folder what i i'm going to do is i'm going to create a text file which we are going to upload to of our git repository so for that i'm going to create a test file and in that i am going to write some content so i have saved this file so to upload this text file this test file to your remote repository you have to give some commands which are there shown here also so some of these commands are shown here also for but we are going to start with some other commands so what you have to do is you have to right click and you have to open git bash here so if you don't have git bash i will provide a link in the description for this git bash installation so you have to open this get bash so it will open to your location that is this location so first command which you have to do is get in it without this command your kit will not work so after giving this command you have to press enter and it will say initialized empty git repository in your location and you will see a folder like dot get is created here so after that what you have to do is you have to check what is the status of your git so if you give this this command gives get status it will give you some information that is no commit yet on a master branch the branch is also shown here that is master branch and contract files are text files so currently there is only one file there so it will show that hunter file is only one so if you i'm going to create one more file here and i have just created a copy of the text file and now if i give the same command so it will show me two files that are untracked so to push your kit push this file to your kit what you have to do is you have to give some commands here so first of all what you have to do is you have to do this global setup so what i'm going to do is i'm going to copy these two commands which will give your kit the information of who you are and that is the basic purpose of that so i'm going to have copied these two commands and i've pasted it here so kit will know that who is the user and what is its purpose so i've given those two commands here after that what you have to do is you have to add your file to the staging area that your that you are going to do using this second command that is git add so git add which file i have to add is test file that is this first text file so after giving this command i'm going to press enter so this file is added to staging area so after that you if you see git status you will see that that file is added in that changes to be committed section and this second file which we have not added that is still in our track files so after that what you have to do is you have to give another command that is git commit that and we have to give some comment message that this is our first comment so you have to give it like git comment hyphen m and the comment message you can give any comment message in your double inverter codes so after that you have to press enter now it will show you like this this is a first commit is the commit message and it has committed to master bench and files change is one file change and insertion is one and create creation mode is like this and now if you see its status then that file is not there in the committed changes to be committed but it has been moved to uh some other section so now if you refresh here that file is still not here but if you give this command that is hit push minus you origin main then that file will be pushed to this repository and you will see the same file uploaded here so what you have to do is copy that and paste it here but now if you see our branch is master so we have to [Music] using master branch so after typing this command that is git push hyphen new origin master and if you press enter then it is giving some error because we have not added our remote we have not given which repository we have to push to so what you have to do is copy this command and you have to paste this once here so when you paste this remote add origin our gate repository url and let me press it now our git will know to which repository we have to push to and then if you run this get push minus get push hyphen you origin master and then you press enter then it will push to your head repository now it is going to ask you your username and your password so your username is given here that is simply done one two three and your password which you know already so after giving your username and password just say okay and now you will see [Music] that upload is started and it has done that it has the file which we have committed earlier that is test file dot txt has been uploaded to this git repository that is on a new branch that is master from where we have uploaded that is master branch and to where we uploaded two same branch that is master branch how many bytes are uploaded are also shown here so now if you say refresh here you will see that same file uploaded here so our commit our last commit will be shown here that is this is our first commit and the text file which you have written in your local deposit now if you see that the content of this text file and this test file is same so we will know that the same file is uploaded here so this is how you can upload all the other files in your git repository [Music] you
Info
Channel: Simply Done
Views: 99,810
Rating: undefined out of 5
Keywords: how to create git repository and push to gitlab, how to create git repository, how to create git project, how to push to git, how to push to gitlab, git creating repository, how to push code to git, how to push code to gitlab, how to upload files to git, upload project folder on gitlab, How to create first repository on Gitlab and upload project to it, how to add commit and push to git, how to add commit and push to gitlab, git push, basic git commands, gitlab, git, github
Id: aA4S3Fl45jo
Channel Id: undefined
Length: 11min 38sec (698 seconds)
Published: Fri Apr 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.