Git Git repository notes ---- common classic operation command

You first create a warehouse operation on a project upload https://www.cnblogs.com/tk55/p/11795644.html

---- good memory as bad written

 

 

 


Updates to the warehouse again

Not for the first time or update content files to a remote repository

. the Add git 
git the commit -m ' comments ' 
// write not write git remote add origin warehouse address 
git the Push - U Origin Master
 // forced to upload git push -u origin master -f

Local retrieve accidentally deleted files

If the file is uploaded to a remote, local accidentally deleted. As shown in the operation color

git status

出现
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    "\346\226\260\345\273\272\346\226\207\346\234\254\346\226\207\346\241\243.txt"

git reset HEAD \346\226\260\345\273\272\346\226\207\346 \ 234 \ 254 \ 346 \ 226 \ 207 \ 346 \ 241 \ 243 .txt 
unstaged Changes After RESET: 
D new text document .txt Git Checkout new text document .txt 
Updated 
        
. 1 path from The index

 

Local delete files, and then update to the remote

Status git 

$ git the Add. 
$ git the commit -m " to delete the existing local file and then update to the server " 

$ git the Push -u Origin Master

 

 

Other operations

Origin Master pull -rebase git // merge the code to a local git 

git the Push -u Origin Master -f   // forced merger remote git Code 
where 
x - delete the file has been ignored for git is not a recognized file 
d - delete not git added to the path of the file 
f - force run 
program. 1: 
git Clean -d - FX "" 
git Push Origin Master 

2 .git Clean - I 
git pull origfin Master 

cover native code (or a version of execution back RESET -hard Git) 
. 3 .git pull-UNRELATED is -ALLOW Origin Master-Histories

 

Guess you like

Origin www.cnblogs.com/tk55/p/11802096.html