Linux git common commands

  
 

Get Git repository

Initialize a version repository

git init

Clone remote repository

git clone [email protected]:wordpress. Git

Add remote repository origin, the syntax is git remote add [shortname] [url]

git remote add origin [email protected]:wordpress.git

View Remote repository

git remote -v

Submit your changes

Add the currently modified file to the staging area
git add .

If you auto track Files, including files that you have manually deleted, with a status of Deleted
git add -u

Submit your changes
git commit –m "your comments"

Push your update to the remote server, the syntax is git push [remote name] [local branch]: [remote branch]
git push origin master

view file status
git status

track new file< Br>git add readme.txt

Remove files from the current tracking list and delete them completely
git rm readme.txt

Remove only in the scratchpad, keep files in the current directory, no longer track
git rm –cached readme.txt

Rename file
git mv reademe.txt Readme

Copyright © Windows knowledge All Rights Reserved