How to Push code from Local machine to GitLab repo using cmd prompt | commit & push Files to GitLab

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello again so today let's see how we can push code from local machine to new gitlab repository using command prompt so I have this uh my own project available on my local machine so this project I want to push to my gitlab repository okay so let's see that now so just go to the gitlab.com and if you have not created any account on the gitlab you can create it so just log in with your credentials so I have this freshly created gitlab account so I don't have any project created so I will go and create a new project in my gitlab so click on create a project then I am going to create a blank project so here you can give the project name so let's say this is my multiple pumps I am giving my project name same as the project that is in the local machine okay then project deployment Target this is optional so I am not going to deploy anything here so no deployment plan I am going to make this as public so that it will be accessible to all of you without any Authentication and this I don't require because I am going to push my code directly to this repository okay so I don't want to create this redmi file by the gitlab so I will uncheck this checkbox and click on create project okay fine so project has been created but there is nothing inside this project okay so this is my remote repository in which I need to push my local code okay so just go to your local where your project is available okay so from this location you just need to open the command prompt okay so you'll be directly reached to that location itself so from this you just need to start one uh local repository local git repository So currently we do not have any git repository in this project okay in this folder so first we need to create the empty git repository so use git init so it will initialize a empty git repository okay so that you can see that this is the hidden folder that is created so inside this local repository and this is my remote Repository so local repository is empty so if you check the status okay there are no commit set because I have not committed anything to my that local repository okay so while pushing your code from local to remote git repository okay it can be gitlab or GitHub first thing is you know to make sure that your files are committed into your local repository and from local mean we are going to push to the remote so first let's get these files into our local repository and then we will push it so what we can do is first I will use git add space Dot so it will add all these files okay that will be ready to be committed so if we check these status now so these are the files shown in green so these files are ready to commit so for commit the files use git commit and here I will give you some message initial commit okay so now these files are part of your local repository so we just need to push this local files to our remote repository now so what you can do is first we need to make a connection of our local repository to the remote repository okay so for that purpose just copy this URL this is your project URL okay repost URL for the project and I will go to command prompt here I will use git remote add origin so what origin you need to add you need to provide the URL of the remote repository okay hit enter okay so let's check the branch now so you can use the git branch So currently it has created the master that is the local branch so now this local Master Branch changes I need to push to the remote Master Branch so I will use git push command git push origin and this is the master Branch I need to push okay so all the changes it has pushed from local machine to our remote repository okay so when you are trying to push it for the first time it will ask you for your credentials your username and password for the gitlab so just enter those credential and you'll be able to push all the codes from local machine to the gitlab repository okay so let's verify it currently it is empty so if you refresh the page you can see our Master branch has created in the gitlab this is the default and protected branch and it contains all the files from the project from the local machine so this is the project available in my local machine I have pushed all the project to my remote gitlab repository okay so this is how you can do it thank you thank you foreign [Music] [Applause]
Info
Channel: AJ AUTOMATION
Views: 31,445
Rating: undefined out of 5
Keywords: gitlab new project, push code from local to gitlab, push existing project to gitlab repository, how to push maven project to gitlab repository, push project to GitLab, gitlab push commit, commit and push to gitlab, push local code to gitlab, push local project to gitlab, create new project in gitlab, git push, gitlab, gitlab tutorial
Id: JvQauyFaEgg
Channel Id: undefined
Length: 5min 40sec (340 seconds)
Published: Fri Jan 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.