How can you push code and cloning by the git command?

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Hello folks, if you have a concept and skills on the git command so, that’s very great otherwise, you could pave your way in the glorious field of programming. Welcome to the admiring world of command that makes your way easy with day-to-day enhances which supports very in your life. This command could create turbulence in your daily workflow with innumerable enormous modes. With one command structure, you could conquer all your miseries over the git commands.

Push code to the remote repository

Suppose, you have a file in that you have done everything and you have to upload that all files on GitHub. So, open your GitHub, if you have your own GitHub account then you will log in to that. After the opening of your account, there will be the repository option. So, clicking on the new option, you will have to take create a new repository in the name all about git. Then you will give a description like this is git status one video repository so, after doing the public option you can create a repository. You can do public or private, whatever you want, there is no issue with that. You will see that there will show something command to you. Suppose, you have files in the name node integration so, which you have files in the node integration. First, you will have to take merge from node integration to the main branch then what will you do for that? You will do checkout in master by putting $ git checkout master. After that, you will put like $ git merge node integration, if you will write node and press tab then it will give to write whole. You will see, your branches will have been merged there. If you will visit vs code then node has also come in master. You could directly upload all files from vs code through the command line, how can you do that? First, you will have to take commit by putting $ git commit –m “All files done ready to upload” and after the commit, you will see git status by putting $ git status. You will have to take copy the command from GitHub and paste it into the command line. If you will have to do push so, you will see one thing over there, you could do two or three things. You have been seen everything how does it make? You have a remote repository that exists on the server. You have all files in the file explorer that you have to upload in it. So, you will put $ git remote then it will show you that it exists on the origin. When you will put $ git remote v then it will show you from where it will do fetch or push, it means you are fetching those files and uploading them on the server. Again, you will run a command for push like $ git origin master so, it will take time in demanding id & password then it will have happened push. When you will see fetching into GitHub and refresh that. Every committed file will be present there when you have committed and created it. You can see commits from there, when you will click on your name then every commit has been uploaded there. This is real benefits reach to our GitHub through the command line.

Clone a project command

Suppose, you have to do a clone, any repository is there. First, you will have to go home, in the name js project repository. You have opened any basic project from there and you have to clone that so, you will move in the code & copy that. So, you have an online js repository that somebody has made, you have to do clone and download it to your system. Then you will have to make a file on the desktop. Suppose, you have made a file in the name clone GitHub so, you will open GIT bash in that. Then you will put $ git clone and after, you will put copied URL with js project that you have done before. So, it will have to give clone, download, and receive. If you will see into GitHub then in the name js project file has been made. When every process will have done so, every file will have come. This is the real meaning of clone, any project exists on GitHub. So, you can directly clone in any repository. You will see that every file has come in the file explorer which another person had uploaded in their own project. Usually, you can do a clone, and anybody of project you can do. Those have a public project, you can do a clone of that. You can give an open-source contribution to that. So, you will use only GitHub because it is very reliable which is from Microsoft and it has seamless services.

Related video: