We use ides and other software to write commands most of the time, but to do our job well, we also need to have a few commands at our fingertips in case we need them.

Here are some common commands I use when I’m developing, and I’m sharing them with you today in the hope that they’ll help you.

1. Initialize the local Git repository Git init

Git clone SSH ://[email protected]/[username]/[repository-name].git

Git status

Git add [file-name.txt]

Add all new and changed files to the staging area git add-a

Git commit -m “[commit message]”

Git rm -r [file-name.txt]

Git branch git branch git branch git branch

Git branch [branch name]

Git branch -d [branch name]

Git checkout -b [branch name]

Git checkout -b [branch name] origin/[branch name]

Git branch -m [old branch name] [new branch name]

Git checkout [branch name]

Git merge [branch name]

Git merge [source branch] [target branch]

17, Store your changes in an inappropriate working directory, git Stash

Git stash clear remove all hidden entries

Git push origin [branch name]

20. Push your changes to a remote repository git push

Update the local repository with the latest commit Git pull

Git pull origin [branch name]

Git remote add origin SSH ://[email protected]/[username]/[repository-name].git

Change git log

Git diff [source branch] [target branch]

conclusion

I hope you found this guide helpful. Any other orders we missed? If so, let me know in the comments!