Git remote command is used to show the remote repository name and URL to which your local repository is connected.Īs the name suggests, the git pull command will fetch all the changes from the remote repository and merge them into your local repository. You can view, create/add, delete, rename remote to other repositories. Git remote command with different options helps to sync the local repository with the remote repository. With this command, you push your local branch to the remote repository. To more your local committed changes to remote use git push command. Syntax: $ git commit -m “Your commit message.” Once you are done with your changes, the git commit command is used to save your change in the git branch. If you want to add all files then use the git add command with “.”. Git add command is used to move new or modified files to the staging area. Git diff command can be used in many different ways and initially, you can use it to check what is modified in a file or directory. This is the best way to know what is modified, added or deleted in your repository. Git status command returns the current status of your working directory. You can find more information about the git config command here. Git config command can also be used to set this config globally. At the start of your project make sure you set the correct user.name and user.email for your project.Įxample: git config user.email Git config command is used to set the git user config for the project or globally. Git branch command can also be used to create a new branch by adding the name of the new branch at end of the command. And the output will highlight the current branch you are in. Git branch command is used to list all the branches on your local repository. With -b option Git checkout branch can also create a new branch from the current branch. Git checkout command is used to switch your current branch to another one. This command is useful when you are starting a new project or want to initialize git in an existing project. Git init command is used to convert a directory into a git repository. Git clone git command is used when you are trying to download a project from a remote repository. Now let's go through them in little detail. In this article, we will go through these 16 basic git commands that you should know as a new developer. As a beginner knowing all the git commands could be overwhelming, but you can get away with some basic git commands at the start.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |