Tuesday, 13 September 2016

How to configure the username on git

How to configure the user name on git.

 

This is simple solution but BIG question .....???

To change/configure the user name at your local machine is very easy, but the user name issue is often trouble to developer.

Usually you will get the below error :-

remote: refs/heads/bugfix/testtagging: bd04a65ec413cecbd11cadc336cb4dd25fa3d935: expected committer name 'Manoj Kumar Bardhan' but found 'manojkumar.bardhan'

To fix this , you need to configure the user name as expected. First check what is the existing user name before set to new.

dev@jdg-developer-desktop ~/testtagging/test $ git config --global user.name
manojkumar.bardhan


Change/Configure the user name by using below command, you can provide your expected user name.


dev@jdg-developer-desktop ~/testtagging/test $ git config --global user.name "Manoj Kumar Bardhan"

Now, you can check again the user name after change/configure.

dev@jdg-developer-desktop ~/testtagging/test $ git config --global user.name
Manoj Kumar Bardhan


Now you can see the old user name was "manojkumar.bardhan" and new user name is "Manoj Kumar Bardhan".


It worked for me, hope it will help you.




Follow for more details on Google+ and @Facebook!!!

Find More :-

How to create tag on github

How to create tagging on git.



Really creating tag is  one of the best practice for development and maintain version. 


As per my understanding production release for your code is a nightmare , we don't know what will happen ???????

Also to maintain the code base stable and safety we need this tagging. This is quite often developers do goooooogle for tagging the their code (branch / master) for safety and reference future use.

This is quite simple , and below example will help you to understand the commands on command line.

Clone your code branch (use clone command to clone the code)

git clone https://your.user.name@stash.jdgnet.com.au/scm/enabler/testcode.git

Switch your expected branch (i.e.  bugfix/jdctagging) , which you want to create tagging and make sure you are inside the expected branch.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git checkout bugfix/jdctagging
Branch bugfix/testing set up to track remote branch bugfix/jdctagging from origin.
Switched to a new branch 'bugfix/jdctagging'
dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git branch
* bugfix/jdctagging
  master


Create the tag with below command, you can specify the tag version name.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git tag -a "v1.taging.version1" -m "commiting with for test tagging for my branch code"

Check the tag got created on above command.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git tag
v1.taging.version1

Push the newly created tag into remote server (stash)

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git push origin v1.taging.version1
Password for 'https://your.user.name@stash.jdgnet.com.au':
To https://your.user.name@stash.jdgnet.com.au/scm/enabler/test.git
 * [new tag]         v1.taging.version1 -> v1.taging.version1

If you don't want to push the tag by name and you want to push all tags then use below command. In my example I have only created one tag and I didn't use the below command.


git push origin --tags


Now you can see the [new tag] got created on remote server. See the snapshot below , showing the tag on stash.






Hope it will help you.





Follow for more details on Google+ and @Facebook!!!

Find More :-