Wednesday 15 November 2017

git Repo

A year before had chat with my Guru/ Friend / Senior/ TL Bala.
He said lot about GIT. would like to do experiments on it.
Now got a chance on it.

went for an interview, they asked to do crud operations and upload it in GitHub.
cannot able to do that on the same day, however, next day, started that process.

so this what i did, 

1. generate ssh key from eclipse.
2. add that ssh key in Github.
3. commit and publish the code.

seems easy right. Yah, it is easy in eclipse. Eclipse made the process simple. I will explain what is happening behind in the part 2.

and that repo https://github.com/hunkr11/intellect i shared with Balaji, my senior in saksoft.
Asked him to fork it.
to my knowledge, forking is like importing my repository in github to his repository, and can make changes in that repository. It won't affect mine.

then ask him to raise a pull request.
well, pull request is after forking and made some changes, then the forked person would like to add their changes to the main copy.
in this scenario, balaji made some changes, he raised a pull request, then i received that intimation. i reviewed balaji's code then merged it.



so, that experiment is successful.


Next, day i want to try the same for angular code using Visual studio Code.

likewise created the repo.
tried to commit the code, show the error unknown user.
after googling, found need to set the user name and email for github to commit

$ git config --global user.name hunkr11

$ git config --global user.name hunkr11@gmail.com
 then is error resolved.

then tried commiting again, the RSA error comes.
after googling understood the flow,

1. need to generated a ssh key(public key) for my github email id.

 ssh-keygen -t rsa -C "hunkr11@gmail.com

2. Add the generated ssh key to git

 ssh-add  (path)/(keyname)

3. add this key to Git as new SSH key

4. configure the user globally

 git config --global credential.helper wincred

that's it. now we can push our code to git using Visual Studio Code.

git remote add origin https://github.com/hunkr11/GIT.git
git push -u origin master

my angular repo: 
https://github.com/hunkr11/angular-shopping-cart