This content originally appeared on DEV Community and was authored by Ajo Alex
Git Config
This command sets the author name and email address respectively to be used wwith your commits.
git config -global user.name "[name]"
git config -global user.email "[email address]"
Git init
This command is used to start a new repository
git init
Git clone
This command is used to obtain a repository from an existing URL
git clone [url]
Git push
This command push the changes to the server
git push <remote name> <branch>
Git merge
This command merge the specified branch into the current branch
git merge [branch name]
Git pull
This command fetches and merges changes on the remote server to your working directory
git pull
Git add
This command adds a file to the staging area
git add
or
git add --all
Git commit
This command records or snapshots the file permenantly in the version history
git commit -m "[commit message]"
Git branch
This commit will create new branch only in your local system
git branch <branch-name>
Git checkout
This will switch you to the branch name you mentioned in the command
git checkout <branch-name>
Git status
This command lists all the files that have to be committed
git status
Git remote
This command used to connect your local repository to the server
git remote add [variable name] [server link]
This content originally appeared on DEV Community and was authored by Ajo Alex
Ajo Alex | Sciencx (2021-07-31T07:12:35+00:00) Essential commands you should know for git. Retrieved from https://www.scien.cx/2021/07/31/essential-commands-you-should-know-for-git/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.