Essential Git Commands

In this post we will learn the basic and essential commands of Git that developers use in their daily lives!

Let’s go!🚀

Settings:

To set the global username

git config –global user.name “username”

To set the global email:

git config –g…


This content originally appeared on DEV Community and was authored by Cinthia Barbosa da Silva

In this post we will learn the basic and essential commands of Git that developers use in their daily lives!

Let's go!🚀

Settings:

To set the global username

git config --global user.name "username"

To set the global email:

git config --global user.email "user@email.com"

Basic Commands:

To initialize a git repository

git init

To clone a repository

git clone <URL>

To check the changes

git status

To add a file

git add my-file

To add all changed files

git add .

To commit your changes

git commit -m "my first commit"

To push changes to the current branch

git push 

To update your branch with changes

git pull

To switch branches

git checkout develop

To update your local repository with remove changes

git fetch

To create a new branch

git branch my-new-branch

Essential Command to Merge and check log:

To merge a branch

git merge my-branch

To check log

git log

To revert a commit

git revert 001

This is for today! If you have any questions, leave me a comment!

And you found this article helpful, please like the post.❤️


This content originally appeared on DEV Community and was authored by Cinthia Barbosa da Silva


Print Share Comment Cite Upload Translate Updates
APA

Cinthia Barbosa da Silva | Sciencx (2024-07-14T18:52:44+00:00) Essential Git Commands. Retrieved from https://www.scien.cx/2024/07/14/essential-git-commands-2/

MLA
" » Essential Git Commands." Cinthia Barbosa da Silva | Sciencx - Sunday July 14, 2024, https://www.scien.cx/2024/07/14/essential-git-commands-2/
HARVARD
Cinthia Barbosa da Silva | Sciencx Sunday July 14, 2024 » Essential Git Commands., viewed ,<https://www.scien.cx/2024/07/14/essential-git-commands-2/>
VANCOUVER
Cinthia Barbosa da Silva | Sciencx - » Essential Git Commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/14/essential-git-commands-2/
CHICAGO
" » Essential Git Commands." Cinthia Barbosa da Silva | Sciencx - Accessed . https://www.scien.cx/2024/07/14/essential-git-commands-2/
IEEE
" » Essential Git Commands." Cinthia Barbosa da Silva | Sciencx [Online]. Available: https://www.scien.cx/2024/07/14/essential-git-commands-2/. [Accessed: ]
rf:citation
» Essential Git Commands | Cinthia Barbosa da Silva | Sciencx | https://www.scien.cx/2024/07/14/essential-git-commands-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.