Git configuration settings

you can specify Git configuration settings with the git config command. One of the first things you did was set up your name and email address:

$ git config –global user.name “Moyen Uddin”
$ git config –global user.email moyen.ruet@gmail.com

useful link: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration

Advertisements

Your branch is ahead of ‘origin/master’ by 3 commits

I’am really new by to doing work in a team of git environment and facing different issues time to time..
This is an issue that I faced today while did some changes in my local files and try to commit and pull/push…

after commit and also did some random changes. At last I got the message “Your branch is ahead of ‘origin/master’ by 3 commits” while try to pull.

So Finally I decided to reset all my changes with remote origin master and it’s so simple with the following (git reset – – hard origin/master) …

Moyens-MBP:corp moyen$ git reset – – hard origin/master

Where it means….

“throw away all my staged and un-staged changes, forget everything on my current local branch and make it exactly the same as origin/master”

 

link:http://stackoverflow.com/questions/15432052/what-is-the-meaning-of-git-reset-hard-origin-master

 

How to ignore error on git pull with local changes would be overwritten by merge?

I have changed some files on my local machine, pushed them to a remote repository, and now I’m trying to pull the changes to the server and I get the message;

error: Your local changes to the following files would be overwritten by merge:
wp-content/plugins/plugin_name/file.php

Please, commit your changes or stash them before you can merge.

====================
So What I simply did that …..

Moyens-MBP:~ moyen$ git checkout wp-content/plugins/pluginname/file.php
Moyens-MBP:~ moyen$ git commit -m “merged”
Moyens-MBP:~ moyen$ git pull
Moyens-MBP:~ moyen$ git push origin master

and this makes override the local file with the remote one (git checkout filepath) and deploys the other changes.

Helpful Link:

http://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me