How to create a new repository and push on Github with Git gui .
Sep 3, 2018 · 2 min read
The first thing you need to do is install Git in your PC depending on your Os(operating system) like mine is Windows ; you can do so with the following steps:
1. Download and install the latest version of Git.
2. Use the default options for each step in the installation.
Pre-requisites after installation
1.Go to your desktop create a new folder and name it.(note:this folder will be used to store your Index. html file) .
2.Inside the folder, create an html file named “Index.html”.
Then
- Launch your Git Gui.
- Click on “new repository” the directory should be the folder you earlier created that is located in your desktop).
- When it opens you click on “Edit" on the menu bar and select option.
- Here in option, you fill in your name and email address then save.
- Then press Rescan to scan project’s folder.
- When rescaned it displays “Untracked, not staged" which means Git is not aware of the file nor prepared.
- Initialize the new repository by typing “initial commit ” then commit.
New Branch
- Create a new branch. We have the default branch “Master". Branches help in terms of managing different web pages.
- Click on Branch,create new branch. Input the name,set it on local branch then create. Note:the current branch changes to the new branch you created.
- Then select repository >visualize all branch history to see if your work is shaping up.
Merge Branches
- Merge the branches I. E (Master branch + new branch). To perform Merge, use merge then local merge.
Push
- Push to remote server:
Before pushing to a remote server, you must first create a SSH public and private key pair. By using SSH, go to help click on SSH, you will be able to securely authenticate to the server that you are who you say you are. Creating the key pair is a simple process. - Next, click the Generate button to generate the keys. Copy the keys to the clipboard.
- Now that the keys are generated, the remote servers need to know about it. If you would like to use github to host your code, just go to your account page and paste in the key.
- Now github has your public key, but you do not yet have github’s. To remedy this, launch
putty.exe, connect to github.com, and click
Yes to accept github’s public key. You can safely close the login window that opens up after accepting the key. - Now that our client and server can authenticate each other, it is time to push! Remote >Push will open up the push dialog. Typing in the commit address for the project and clicking Push will send the changes on their way.
