Added stash, amend rebase and gitignore
This commit is contained in:
		
							parent
							
								
									82ec9d32c1
								
							
						
					
					
						commit
						607672cd65
					
				
							
								
								
									
										30
									
								
								readme.md
								
								
								
								
							
							
						
						
									
										30
									
								
								readme.md
								
								
								
								
							| 
						 | 
				
			
			@ -210,4 +210,32 @@ temporarily stash your work since your last commit
 | 
			
		|||
 | 
			
		||||
>git stash pop
 | 
			
		||||
 | 
			
		||||
fetch your stashed work to continue it
 | 
			
		||||
fetch your stashed work to continue it
 | 
			
		||||
 | 
			
		||||
$ git stash pop stash@{2}
 | 
			
		||||
 | 
			
		||||
in case you want to apply a specific Stash item (not the most recent one), you can provide the index name of that item in the "pop" option
 | 
			
		||||
 | 
			
		||||
### Rewriting history 
 | 
			
		||||
 | 
			
		||||
>git commit --amend -m "New commit message"
 | 
			
		||||
 | 
			
		||||
replace the message of the last commit without altering the snapshot
 | 
			
		||||
 | 
			
		||||
>git commit --amend --no-edit
 | 
			
		||||
 | 
			
		||||
replace the latest commit with a commit that includes recents git add
 | 
			
		||||
 | 
			
		||||
>git rebase -i {branch}
 | 
			
		||||
 | 
			
		||||
take the precedent commit and add it to your branch
 | 
			
		||||
 | 
			
		||||
### Ignoring files
 | 
			
		||||
 | 
			
		||||
>touch .gitignore && echo {what you want to ignore} >> .gitignore
 | 
			
		||||
 | 
			
		||||
create a file and specify what (extensions, directories, files) to ignore in it
 | 
			
		||||
 | 
			
		||||
>git rm --cached {fileignored}
 | 
			
		||||
 | 
			
		||||
remove from the tracking index a file that should be ignored but wasnt because already tracked when the ignore rule was created
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue