mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	help.github.com seems to have a bug where HEAD on a redirected page returns 404. This causes tools/test-documentation to fail. Fix it by skipping the redirects. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
		
			
				
	
	
	
		
			1.4 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.4 KiB
		
	
	
	
	
	
	
	
Fixing Commits
This is mostly from here.
Fixing the last commit
Changing the last commit message
git commit --amend -m "New Message"
Changing the last commit
- Make your changes to the files
 - Run 
git add <filename>to add one file orgit add <filename1> <filename2> ...to add multiple files git commit --amend
Fixing older commits
Changing commit messages
git rebase -i HEAD~5(if, for example, you are editing some of the last five commits)- For each commit that you want to change the message, change 
picktoreword, and save - Change the commit messages
 
Deleting old commits
git rebase -i HEAD~nwherenis the number of commits you are looking at- For each commit that you want to delete, change 
picktodrop, and save 
Squashing commits
Sometimes, you want to make one commit out of a bunch of commits. To do this,
git rebase -i HEAD~nwherenis the number of commits you are interested in- Change 
picktosquashon the lines containing the commits you want to squash and save 
Reordering commits
git rebase -i HEAD~nwherenis the number of commits you are interested in- Reorder the lines containing the commits and save
 
Pushing commits after tidying them
git push origin +my-feature-branch(Note the+there and substitute your actual branch name.)