Showing posts with label GitHub. Show all posts
Showing posts with label GitHub. Show all posts

January 18, 2017

Git Installation

January 18, 2017 102
Git :

Git is a version control system (VCS) for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for software development,but it can be used to keep track of changes in any files. As a distributed revision control system it is aimed at speed,data integrity and support for distributed, non-linear workflows

Steps to Install Git:

Download Latest Git installer  Git For Windows.

While installing Git make sure you check 2 check boxes. GIT Bash and GIT GUI.


When you've successfully started the installer, you should see the Git Setup wizard screen. Follow the Next and Finish prompts to complete the installation.

While installing keep default options that will be ok for most of the users.


Once the installation is done if you search for git you will see Git Bash and GitGUI.

GitBash:

Git for Windows provides a BASH emulation used to run Git from the command line. *NIX users should feel right at home, as the BASH emulation behaves just like the "git" command in LINUX and UNIX environments.



GitGUI:

Git for Windows also provides the Git GUI, a powerful alternative to Git BASH, offering a graphical version of just about every Git command line function, as well as comprehensive visual diff tools.


Shell Integration:

Simply right-click on a folder in Windows Explorer to access the BASH or GUI.



Next Post on Create Repository and Clone it to Local Machine.

Create Repo Using GitHub


Git and GitHub

January 18, 2017 9
Git and GitHub
In this article I will discuss about Git and GitHub.

First question comes in everybody's mind, what is Git and what is GitHub. Both are same or different?


GIT:
Below is the definition from GIT official site.
 (https://git-scm.com/)
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency

Git is a distributed version control system.

There are two types of  version control systems out there. “centralized” and “distributed”.

Centralized:
A single place everyone can check in and check out.  Example :CVS, Subversion, and Perforce

Distributed:
Every developer/user has their own repo. Everyone can push changes into a common repo. Example : Git, Mercurial, Bazaar or Darcs


The below diagram show the core difference.

SVN & Git - Git Actions





To know more or practice git commands please see this link https://try.github.io/levels/1/challenges/1


GitHub:

Online project hosting using Git. It Includes source-code browser, in-line editing, wikis and ticketing. Free for public open-source code.

GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.


Below are some of the advantages of GitHub:


  • Version control your projects
  • Push your projects to GitHub and let the world know how nice and useful code you write
  • Explore other’s projects on GitHub, get inspired code more, or contribute to their project
  • Collaborate with others, by letting other people contribute to your projects or you contributing to other’s projects

Below are some posts related to Git and Github.

Git Installation

Create Repo Using GitHub

How to use Git commands



September 2, 2015

Creating a Github Repository for Selenium Webdriver Project

September 02, 2015 4
This post is regarding Creating a repository using Git and Eclipse.


GitHub:
  1. GitHub is a Web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features. More information about GitHub: Click Here
What is need of Version Control System?

Version Control/Source Control/Revision Control is a system remembers history of your files.

Ex:
Below are some of the reasons why we use Repository. 
1. Lets assume there are 4 resources in your project and Resource 1 developed a function which is useful to other members, then he need to save that file in central location where every one can get that function.
2. Made a change to code, realized it was a mistake and wanted to revert back
3. Lost code or had a backup that was too old
4. Wanted to see the difference between two (or more) versions of your code

Advantages:
  • Made a change to code, realized it was a mistake and wanted to revert back?
  • Lost code or had a backup that was too old?
  • Had to maintain multiple versions of a product?
  • Wanted to see the difference between two (or more) versions of your code?
  • Wanted to prove that a particular change broke or fixed a piece of code?
  • Wanted to review the history of some code?
  • Wanted to submit a change to someone else's code?
  • Wanted to share your code, or let other people work on your code?
  • Wanted to see how much work is being done, and where, when and by whom?
  • Wanted to experiment with a new feature without interfering with working code?

Create GitHub Account:

Navigate to Join GitHub and Create an account.

By default Free account will be chosen. Click Finish Signup button.
You will get a verification email and click Verify Email button in that email.
After clicking that it will navigate you to GitHub Home Page. Where you can create repositories.

Prerequisites:
Eclipse Latest Version (At least Luna)
Sample Webdriver Project using Maven (Create-sample-maven-project.html)
GitHub Account

Steps to Create Git Repository:
1. In eclipse Right click on Project Team --Share Project.
2. Select Git and Click Next.
3. Click on Create button and Give path of local repository (F:\Gitrepo)

4. Now Enable Git related Views ... Window--Show View --Other --Git --Git repositories and Git Staging

5. Now if you observe project is moved to (F:\Gitrepo)
6. Now lets commit our changes to local repo.. Right click on project --Team---Commit
7. Enter a commit message this is a best practice and select files you want to commit. Click Commit.


8. Once you committed it will create a master under local folder.
9. Now Navigate to GitHUb and create a repository.
10. Once the repo is created copy repo URL as shown in below screenshot.

11. Now back to eclipse and Right click on remotes under Git repositories --Create Remotes
12. No Need to change name..Click OK.
13. in the next screen click Change and enter repo url and credentials.


14. Click advanced select Master from dropdown and click add spec and check save configuration check box...click finish..
15. Click Save.
16. Expand remote under Git repositories and you can see Origin under remote folder.
17. Right click on Red arrow Under Origin and select push.

18. Changes will be pushed to repo. Check your Github repo.



This is How to create repo in Github....

Update local file and commit changes to Gitrepo:

1. Update one file in eclipse.
2. 

3. Right click on File Team --Commit and enter commit message


4. Click Commit and Push..Enter credentials changes will be pushed to repo.
5. 


Thats it..this is how to create repo and commit your changes.