Thursday, June 8, 2017

Sync up your fork with upstream without creating merge commit

From your fork on the local machine

cd  <fork>
git checkout master
git fetch upstream
git rebase upstream/master
git push -f

This will make your fork match up with what's upstream

 
 

Tuesday, June 6, 2017

Remove CTRL-M characters from a file in UNIX

Recently one of my files started getting these ^M characters at the end of each line. I wanted to remove them quickly and use sed to remove them



sed -i "s/^M//" filename
You need to enter ^M by pressing Ctrl and then pressing V and M in succession



Remove CTRL-M characters from a file in UNIX