telekommander
3/20/2014 - 12:08 PM

Useful GIT commands

Useful GIT commands #git

# Checkout
git checkout --orphan latest_branch

# Add all the files
git add -A

# Commit the changes
git commit -am "commit message"

# Delete the branch
git branch -D master

# Rename the current branch to master
git branch -m master

# Finally, force update your repository
git push -f origin master
git rm -r --cached path_to_your_folder/
git checkout your-feature-branch
git pull --rebase origin master
git checkout -b branchname remotes/origin/branchname --

#OR SHORTHAND
git checkout --track origin/branch_name
git checkout master
git pull origin master
git merge test
git push origin master
# FORCE GIT PULL - OVERRIDE LOCAL CHANGES
git fetch --all
git reset --hard origin/master
git commit --amend --author="John Doe <john@doe.org>"