![]() ‐ Sets the email you want attached to your commits. ‐ Sets the user name you want attached to your commits. You will also need to create a free GitHub account here:Īnd then use these to learn how to use Git:Ĭonfigure user information for all local repositories $ git config -global user.name "" To get started with Git, you first need to download it to your computer from here: Git commands are ran from the command line inside of It can be used to track changes, coordinate work with others, and test branches before publishing. To discard all the temporary changes made in the staged area.Git is a version-control system that is used for tracking changes in source code. To save all the modified changes temporarily in the staged area. In the current branch, remove all the staged changes and start from latest changes available in the commit id In the current branch, apply the changes available in the commit id To move the file from one path to another and stage the changes To show the difference available between the branches To display the commit history of the current branch To create a new branch and move directly to that branch. ![]() To list the available branches for that repo To delete a branch available in the online repo If the connection requires upstream (tracking) reference then add the flag ` -u` to the command To publish the committed version online, use git push with the name of the remote connection and branch name. To remove the particular remote connection using the name that we provided. To add a new online repository and provide a name for that repo (for future references) To list all the connected online repository Commits can be made along with the description of that version like what is the change is all about. To commit the staged file which are ready to make the new version of the repository. To differentiate the committed files from the staged file use git diff -staged To differentiate the staged files from the un-staged file use git diff. To display the modified files in the working folder ![]() File can be added individually using the file name or more than one file can be added at a stretch using `. To add the file from the working directory to the stagging area. To initialize a working directory as git repository Used to combine the action of git fetch and git merge. To merge the latest changes from the online repo ![]() To fetch the latest changes from the online repository while working in the local repository to see the changes (without modifying it) To list all the files available in the directory Git clone To clone the online repository to the local The flag –global is necessary to set for all the repositories, otherwise it will be applied for that particular directory. Flag ‘true’ is set for Windows OS and the flag ‘input’ is set for OS Xįor the ease of command line differences, color coding can be automatically be set by configuring in the global. ![]() To configure the carriage return of the file ending line. “Code” represents VS Code and other editors include Vim, Emacs, Nano, Sublime and Atom To set the default editor for all the command line editing. Git config -global core.editor "code -wait" To identify the local user and used for the commits. To set user name for the local system (may not be same as the online repository) Git Bash will be the best tool for performing all the git commands and that can be downloaded from the git-scm website This article is for a quick reference of all the basic git commands that is used on a daily basis by every other coder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |