Skip to main content

How to make a private repository in Git Hub

 



Step 1 is to create a gitignore file in that directory. So open Git Bash in the desired directory. Then use the command below to accomplish the task.

Here you can add name of files or folders which you don't want to add in your github repository. Adding the file name or file directory name will simply ignore that file or file directory.

touch .gitignore


Step 2 is to Initialise. So use the command below to initialize.

git init

Step 3 is to add content to staging area. So use the command below to add all the content to staging area and prepare all the content to be added to your repository. 

git add .

Remember all the files except the file names added in the gitignore file will be added to the staging area.

Step 4 is to make our first commit. So use the command below to make a commit. Here i called my first commit as "Initial Commit" you can call it "First Commit" or whatever you like.

git commit -m "Initial Commit"

Step 4 is an optional step, but i insist you to perform this step so that you can check that every thing is working fine.

git status

You will see the following result after executing the command on you Git Bash.

On branch master
nothing to commit, working tree clean

Step 4 is to tell our Git Bash about the desired Github repository, in which we want to add the files and folders.


git remote add origin git@github.com:USERNAME/REPOSITORY-NAME.git


Step 4 is the last step in which we all the desired files and folders to our Github Repository. You the command below to accomplish the task.

git push -u origin master


Now you will see your being uploaded to your Github Repository.



Comments

Popular posts from this blog

Access or select tags, items, div, class, id, etc using xpaths | Scrapping Guide

When we learn web scraping or web automation its very important to understand the concepts of "XPATHS" and using them to get most benefit.  You would be surprised to know that XPATHS Version 1 was created in 1999 and since then we have many version of xpaths and many more to come. But current browsers only support XPATHS Version 1 . Learning XPATH is really easy as well interesting.  Now I will tell you about the structure of XPATHS in rest of the Blogpost Structure of XPATHS   There no need to go deep inside XPATHS if you primarily want to learn web scraping or web automation but remember these two points given below to make your life easier. Remember that a XPATH always start with two forward slash "//"  After 2 Forward slash comes the element name such as "p", "div", etc. Example of XPATH: Here are 3 examples which will facilitate the learning of XPATH and will make the stuff as easy as a loaf of bread. Example...

How to change working directory of a python program - Using built in OS Module

 This blogpost is all about finding your current working directory and changing according to your choice Check current working directory for python program Follow the code snippet below to find your current working directory. This is the path in which your python program is currently running. import  os print ( os. getcwd ()) Change current working directory of your python program Follow the code snippet below to accomplish the task. import  os os. chdir ( ' c://desired_folder ' ) This will change your current working directory path to your desired path