Git Commands
Revert last commit without loosing changes?
Section titled “Revert last commit without loosing changes?”git reset --soft HEAD~1Merge without commit and fast forward
Section titled “Merge without commit and fast forward”git merge branch_name --no-ff --no-commitGit Config
Section titled “Git Config”https://gist.github.com/lifuzu/9490352
# There are 3 levels of git config; project, global and system.
# project: Project configs are only available for the current project and stored in .git/config in the project's directory.# global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.# system: System configs are available for all the users/projects and stored in /etc/gitconfig.
# Create a project specific config, you have to execute this under the project's directory.$ git config user.name "John Doe"
# Create a global config$ git config --global user.name "John Doe"
# Create a system config$ git config --system user.name "John Doe"You can use the git config command to change the email address you associate with your Git commits. The new email address you set will be visible in any future commits you push to GitHub from the command line. Any commits you made prior to changing your commit email address are still associated with your previous email address.
Setting your email address for every repository on your computer
Section titled “Setting your email address for every repository on your computer”-
Open Terminal.
-
Set an email address in Git. You can use your GitHub-provided
noreplyemail address or any email address.Terminal window git config --global user.email "YOUR_EMAIL" -
Confirm that you have set the email address correctly in Git:
Terminal window $ git config --global user.emailemail@example.com -
Add the email address to your account on GitHub, so that your commits are attributed to you and appear in your contributions graph. For more information, see Adding an email address to your GitHub account.