/ Javascript & Node.js

Git and GitFlow useful tips


5 tips :

  1. Pull as often as you can
  2. Commit early and often (git commit)
  3. Push only when your changes are functional and fully tested
  4. When you commit, write a decent commit messages that tells reviewers of your pull request what to expect in the commit. And not a simple message like "Fix bug homepage".
  5. use git-flow who is a set of git extensions to provide high-level repository operations and simplify release management.
# Caching git password in terminal
git config credential.helper store

git config --global credential.helper cache

# Set the cache to timeout after 1 hour
git config --global credential.helper 'cache --timeout=3600'

git config --global user.name "your user name"
git config --global user.email "youruseremail@example.com"
git config --global core.editor nano
git init 

clone a remote repository
git clone https://www.nano.ovh/github

Display all commits and history 
git log

# Record the current state of the working directory and the index, 
# then go back to a clean working directory
git stash
git pull
# Restore the last saved state easily and delete its representation on the Stash
git stash pop

# Creates 5 branches by default: feature, develop, release, master and hotfix
git flow init