Git tips (1)

Remove a file from a Git repository without deleting it from the local filesystem

git rm --cached <fileName>  
git rm --cached -r <dirName>  
git commit -m "Removed folder from repository"  
git push origin master  

How do I update a GitHub forked repository?

# Add the remote, call it "upstream":

git remote add upstream

# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:

git fetch upstream

# Make sure that you're on your master branch:

git checkout master

# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:

git rebase upstream/master  

Push existing project into Github

git init  
git add .  
git commit -m "Initial commit"  
git remote add origin <project url>  
git push -f origin master