-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label Git & Github. Show all posts
Showing posts with label Git & Github. Show all posts
  • Github Actions CI CD Pipelines WorkFlows

     

    Github Actions CI CD Pipelines WorkFlows

     

     Hello Viwers, I am back again with another blog and the topic name is Github Actions CI CD Pipelines WorkFlows. So in this blog we will consider so many thing about CI/CD pipelines workflows like what is Github Actions, how to use - step by step, can i used github actions for CI/CD, A demo workflows file - How to create, run and check results, Terms: Workflows, Events, Jobs, Steps.


    Can i used github actions for CI/CD?



    Yes, GitHub Actions is commonly used for Continuous Integration (CI) and Continuous Deployment (CD) workflows.


    What is Github Actions?



    GitHub Actions is an automation platform provided by GitHub that allows you to set up workflows for your software development projects. It enables you to automate various tasks, such as building, testing, and deploying your code directly from your GitHub repository.

    Key features of GitHub Actions include:


    - Automate SDLC workflows

    - Implement CI CD DevOps

     

     


     

     

    Demo

     

    Let's start with the demo how to use github action. Actually you don't got anywhere for using CI/CD, you can use all features in GitHub Action.

    Step 1 - Signup and Login to GitHub.com 

    Step 2 - Create a new Repository

     Go to this  + Plus button dropdown. Click on new repository.

     

    Github Actions CI CD Pipelines WorkFlows

     

     Now i will called as github-actions and set as public and click on create repository button (when go to scroll down on same page).


    Github Actions CI CD Pipelines WorkFlows


     Step 3 - In the repo create a folder .github/workflows

     here you can either create manually and then commited push to the repository. or you can go to this action tab.

     

     

    Github Actions CI CD Pipelines WorkFlows

     

     here you can see the github actions and you can also use templates or use workflows yourself but we will go to setup workflows as yourself.


    Github Actions CI CD Pipelines WorkFlows



    Step 4 - In the folder create a YAML file with .yml extension


    Here this will automatically create .github/workflows folder  and the name of main.yml file but this is empty code. yaml is programming language and .yml this is a file format but particular syntax.

     

     

    Github Actions CI CD Pipelines WorkFlows

     

      

    Step 5 - Add the content of the workflow in the file


    Now content adding time..

    Go to this link and copy the syntax of printing of hello world and you can also use online yaml formater online as a precautions of indentation error.

    Hello World - CLICK HERE

    YAML Formatter - CLICK HERE

     

     

    name: hello-world
    'on': push
    jobs:
      my-job:
        runs-on: ubuntu-latest
        steps:
          - name: my-step
            run: echo "Hello World!"
    
    

     

     

     

    Certainly! The YAML code you've provided is a simple GitHub Actions workflow. Let's break down each part:

    ```yaml
    name: hello-world
    ```


    This sets the name of your workflow. In this case, it's named "hello-world." This name is just for your reference and doesn't affect the functionality of the workflow.

    ```yaml
    on: push
    ```


    This specifies the event that triggers the workflow. In this case, the workflow will be triggered whenever there is a `push` event to the repository.

    ```yaml
    jobs:
      my-job:
        runs-on: ubuntu-latest
        steps:
    ```


    Here, you define a job named "my-job" that runs on an `ubuntu-latest` virtual machine. This means the steps within this job will be executed on a machine with the latest version of Ubuntu.

    ```yaml
      - name: my-step
        run: echo "Hello World!"
    ```


    Within the job, you define a step named "my-step." This step uses the `run` key to specify the command that should be executed. In this case, it's a simple command to echo "Hello World!" to the console.

    So, when a `push` event occurs in your repository, GitHub Actions will execute this workflow. The workflow consists of one job named "my-job," which runs on an Ubuntu machine. In that job, there's a single step named "my-step" that echoes "Hello World!" to the console.

    This is a basic example, and GitHub Actions can be extended to perform more complex workflows, such as running tests, building and deploying applications, and more, depending on the needs of your project.

     

     

     

    Github Actions CI CD Pipelines WorkFlows

     

    Step 6 - Commit and push the changes

     

     

    Github Actions CI CD Pipelines WorkFlows

     

     

    This should start with github actions workflows.

     

    Step 7 - Go to Repo main page and click "ACTIONS TAB" 

     

     

    Github Actions CI CD Pipelines WorkFlows

     

     

    So this is our workflow



    Step 8 - Select the workflow from left sidebar and check the logs

     


    Github Actions CI CD Pipelines WorkFlows



    Here is the single job ( i have only one thats why)  When we click on this job, here we can see the logs. Here we have a job. 


    # First it is setup that will the spin up ubuntu system, as you can see, it is running the ubuntu image (operating system).

    # Second this is the actual job. By step here it is running, this comment "echo hello world" which is printing hello world. 

    # Third one is completing the job, doing all the cleanup process.

    So, This is how it is running ...ummm looking good LOL ;-)



    Github Actions CI CD Pipelines WorkFlows


    Also if you want to re-run this job, you can also click on it.



    Github Actions CI CD Pipelines WorkFlows

    Github Actions CI CD Pipelines WorkFlows



    You can also check all types of detals like Usage, Workflow file.

    Don't forget to explore more things and forget to share....




     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

     
  • Full tutorial of Git and Github

     

    Full tutorial of Git and Github

     

     

    Git and Github

     

    Hello guys how's it going today I'm going to be telling you guys about git and github and give a fully practical tutorial all right so what is git now if you read the Wikipedia page you probably find that it says something like distributed version control and/or distributed version management system something along those lines now what does that mean if you're not in software development just getting started that Prabhas mean very much to you so let's start from the beginning what our source codes source codes are very simply just files in folders now like the way you have Word documents you also have your code is stored in files and folders just like Excel files or any other Word documents for that matter why do we need version control for your source code well in programming a lot of people work together on a lot of files.


    For example if you're building a web application or an iOS application or an Android application for that matter there's going to be a bunch of files and a bunch of folders now I know that's a very like generalized simplified way of looking at it but that's all it really is at the end of the day so if we have files and folders why can't we just work on files and folders and not worried about version control well here's the thing have your work on a Word document and when you share that with your friend and you share it using Dropbox and you both open the file at the same time what happens!! when you work on it together you override each other's changes now that's where version control comes in having version control allows you to track what you've worked on what your friends are working on so you don't clash the changes and you don't override each other changes and even if you do work on the same files the version control system will tell you that oh dude you're going to override your friends changes don't do that or if you want to you want to take a look at like you want to control how it merges together you can do that.



    So you can't do any of that stuff without version control that is the very reason why we use version control is to allow us to work together and collaborate in a more efficient manner now let's talk about the distributed part we have version control which is git which is installed in our local machine and then we have a you know your friend has version control that's gate that's installed on his machine how do you get them to sync up now they can actually talk together if you if you your friends computer and your computer are in the local network you guys can actually send each other you know git commits and it'll sync up just fine if provided you set it up right that's the beautiful thing about being distributed now the better way to work would be to have a central source something like github where you can just push your changes to there and then your friends can just pull those changes down from the cloud and then you guys work together in this centralized server or service it can be bitbucket or could be github or you can even host your own.

     

     

    git init - The git init command is used to initialise a blank repository. It creates a .git folder in the current working directory


    git add . - The git add command is used to add changes in the staging area. when the git add is used with the full stop, it's add all the files in the repository to the staging area.



    git commit - The git commit command is used to save the changes to the local repository. The command helps you keep record of all the changes made.


    git commit -m "Adding repo structure for trojan."
    git commit -m "Adding repo structure for status."


    git status - The git status command is used to display the state of the current repository and the staging area.



    git merge - The git merge command is used to integrate different branches into a single branch.

    The process of merging can be defined as a way of the putting a forth history back together.



    git push - The git push command is used to upload the content from the local repository to the remote repository. Full tutorial of Git and Github



     

     

    Practical Time

    So, lets move on first to check version of git ottherwise if git is not installed in your system, type this command and install it..

    For linux - sudo apt-get install git

    For windows - mac - other linux distroCLICK HERE

     

     

    First we check git version: $ git --version

     

     

    hackerboy@KumarAtulJaiswal ~/Desktop> git --version
    git version 2.30.2
    hackerboy@KumarAtulJaiswal ~/Desktop> 
    
    

     

     

    then we configuration our name and email becuase if any changes done by you so others will know that this line, features, branch etc you have added.




     

     

    hackerboy@KumarAtulJaiswal ~/Desktop> sudo git config --global user.name "Kumar Atul Jaiswal"
    hackerboy@KumarAtulJaiswal ~/Desktop> sudo git config --global user.email "kumaratuljaiswal222@gmail.com"
    
    
    

     

     

    if you want to check name and email are successfully set or not and even you want to edit so let's try this:




     

     

    hackerboy@KumarAtulJaiswal ~/Desktop> sudo git config --global user.name
    Kumar Atul Jaiswal
    hackerboy@KumarAtulJaiswal ~/Desktop> sudo git config --global user.email
    kumaratuljaiswal222@gmail.com
    hackerboy@KumarAtulJaiswal ~/Desktop> 
    hackerboy@KumarAtulJaiswal ~/Desktop> sudo git config --global --edit
    hackerboy@KumarAtulJaiswal ~/Desktop> 
    
    

     

     

    Now, we are creating project with this name and email: so, first of all we made a new directory and then if you want to that's dir convert into repository




     

     

    hackerboy@KumarAtulJaiswal ~/Desktop> 
    hackerboy@KumarAtulJaiswal ~/Desktop> mkdir learn-git
    hackerboy@KumarAtulJaiswal ~/Desktop> cd learn-git
    hackerboy@KumarAtulJaiswal ~/D/learn-git> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git> sudo git init
    hint: Using 'master' as the name for the initial branch. This default branch name
    hint: is subject to change. To configure the initial branch name to use in all
    hint: of your new repositories, which will suppress this warning, call:
    hint: 
    hint:   git config --global init.defaultBranch <name>
    hint: 
    hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
    hint: 'development'. The just-created branch can be renamed via this command:
    hint: 
    hint:   git branch -m <name>
    Initialized empty Git repository in /home/hackerboy/Desktop/learn-git/.git/
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

     

    with this (.git) you get to know which other directories, files, are in this repo because git is tracking them all




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> ls -la
    total 20
    drwxr-xr-x  3 hackerboy hackerboy  4096 Jun  4 06:29 ./
    drwxr-xr-x 94 hackerboy hackerboy 12288 Jun  4 06:27 ../
    drwxr-xr-x  7 root      root       4096 Jun  4 06:29 .git/
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

     

    Now, we are a new file(project file) and check status with git status for what changes(modified, delete, add) in this repo.




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    
    No commits yet
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            add.py
    
    nothing added to commit but untracked files present (use "git add" to track)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    

     

     

     

    see the above untracked file let's add the file.




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git add add.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    
    No commits yet
    
    Changes to be committed:
      (use "git rm --cached <file>..." to unstage)
            new file:   add.py
    
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    

     

     

    Now, we are in the staging area. Staging area thats mean the place where we hold the own changes before commited.





     

     

     

     

     

    For commit after adding in staging area and if we ignore ( -m ) option, So any editor can open here like nano, vim, mousepad etc..so that's why we're using it and besically (-m) for message..




     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git commit -m "initial commit"
    [master (root-commit) e910f6b] initial commit
     1 file changed, 6 insertions(+)
     create mode 100644 add.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

     

    Now, with this command "git log" we can check to how many commit in the previous time.. As if this author had committed this time and a hashcode is also generated here.




     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git log
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77 (HEAD -> master)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

    So now we make some small changes inside the file and then with the help of "git status" command we see what it shows.




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Changes not staged for commit:
      (use "git add <file> .." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   add.py
    
    no changes added to commit (use "git add" and/or "git commit -a")
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    

     

     

    Now we create a another new file OK! and then check once again


    modified file is add.py and
    untracked file is atul.py


    here, we some changes in add.py


     

     

     


     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   add.py
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            atul.py
    
    no changes added to commit (use "git add" and/or "git commit -a")
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

    let's add this atul.py file


    If you want to add only one file now and not the other then you can do this.
    now atul.py file is added in staging are let's commit this.




     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git add atul.py
    [sudo] password for hackerboy: 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Changes to be committed:
      (use "git restore --staged <file>..." to unstage)
            new file:   atul.py
    
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   add.py
    
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    

     

     

    sudo git commit -m "adding atul.py".




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git commit -m "adding atul.py"
    [master 62ca770] adding atul.py
     1 file changed, 2 insertions(+)
     create mode 100644 atul.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    
    

     

     

    Now git status only one file (add.py) remaining here(this is modification file - add.py) .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   add.py
    
    no changes added to commit (use "git add" and/or "git commit -a")
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

    So, if we check log file with git log command, as you can see here are two files commited.
    first one is atul.py and second one is starting commit..
    (HEAD is a pointer so it keeps on moving from commit to commit.
    .




     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git log
    commit 62ca770ab7c38abccb8f456900a47a55b05c3bf5 (HEAD -> master)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:06:28 2021 +0530
    
        adding atul.py
    
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    

     

     

    so what happend next? You can also (git add . ) this will ensure that all the files will be added to the staging area. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git add .
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git commit -m "added message in add.py"
    [master 744a177] added message in add.py
     1 file changed, 4 insertions(+), 4 deletions(-)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    let's check git log command and here are 3 commited file...




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git log
    commit 744a177504dd38541098ea79a5bb8feb982442f4 (HEAD -> master)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:15:00 2021 +0530
    
        added message in add.py
    
    commit 62ca770ab7c38abccb8f456900a47a55b05c3bf5
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:06:28 2021 +0530
    
        adding atul.py
    
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    
    

     

     

    Now let's going back to past...Because some discard or change in the file. .




     

     

    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    
    
    
    

     

     

    first you need to any hex code that you want to copy, so we copy the hash code of initial commit. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git checkout e910f6b5f1208c697329ed4207d8cd57e598ee77
    Note: switching to 'e910f6b5f1208c697329ed4207d8cd57e598ee77'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at e910f6b initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))>
    
    

     

     

    After this as you can see this file has been deleted. .

     





     

     

     

    and if you want to back again in master..
    so type this command and as you can see (add.py and atul.py) file revert back and Switched to branch 'master'. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> sudo git checkout master
    Previous HEAD position was e910f6b initial commit
    Switched to branch 'master'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    again deleted. .


     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git checkout e910f6b5f1208c697329ed4207d8cd57e598ee77
    Note: switching to 'e910f6b5f1208c697329ed4207d8cd57e598ee77'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c 
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at e910f6b initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))>
    
    
    

     

     


     

     

     

     

    Now we slowly slowly come in the concept of branch and the head is inside this branch (HEAD detached at e910f6b) .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> sudo git branch
    * (HEAD detached at e910f6b)
      master
    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> 
    
    

     

     

    now we check git log and as you can see here are only commit file becuase we are in this branch (HEAD detached at e910f6b) and in this branch only 1 file is available. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> git log
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77 (HEAD)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> 
    
    

     

     

    and if you want to check previous all commit So you have to come inside this branch(master) .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git ((e910f6b5…))> sudo git checkout master
    Previous HEAD position was e910f6b initial commit
    Switched to branch 'master'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    All changes are here .



     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git log
    commit e584eac2994d004ddfc1ce89f4d235bb25b9682c (HEAD -> master)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:38:29 2021 +0530
    
        added message in add.py
    
    commit 744a177504dd38541098ea79a5bb8feb982442f4
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:15:00 2021 +0530
    
        added message in add.py
    
    commit 62ca770ab7c38abccb8f456900a47a55b05c3bf5
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:06:28 2021 +0530
    
        adding atul.py
    
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    

     

     

    So, now we see the branch concept

    Each repository can have one or more branches. The main branch — the one where all changes eventually get merged back into, and is called master. This is the official working version of your project.
    This means that you want that there are many features in one branch and updating some things in one feature and does not have any side effect on other features, so that is why we can create or create many branches inside one branch..like tree concept .



    lets create another branch

    git branch <branch name>

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git branch developer
    [sudo] password for hackerboy: 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git branch
      developer
    * master
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    
    
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git checkout developer
    Switched to branch 'developer'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    
    

     

     

    So, now we see the branch conceptgit checkout -b kumar/multiply
    okay here, why we are using -b, basically with -b command we are directly checkout (enter) into multiply branch and by this name(kumar) it is known that who is updating in what way in this project. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> sudo git checkout -b kumar/multiply
    Switched to a new branch 'kumar/multiply'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> 
    
    

     

     


     

     

     


     

     

     

    git status



     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> git status
    On branch kumar/multiply
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            multi.py
    
    nothing added to commit but untracked files present (use "git add" to track)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> 
    
    
    

     

     

    add and commit .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> sudo git add multi.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> sudo git commit -m "added multi.py"
    [kumar/multiply fe6515e] added multi.py
     1 file changed, 6 insertions(+)
     create mode 100644 multi.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> 
    
    

     

     

    when we come back to developer branch as you can see multi.py file has been removed .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (kumar/multiply)> sudo git checkout developer
    Switched to branch 'developer'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    
    
    

     

     

     


     

     

     

     

    But now we want to bring the multi.py file inside the developer branch because now we think that our features are ready. sudo git merge kumar/multiply .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> sudo git merge kumar/multiply
    Updating e584eac..fe6515e
    Fast-forward
     multi.py | 6 ++++++
     1 file changed, 6 insertions(+)
     create mode 100644 multi.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> sudo git log
    commit fe6515e67a1b9015626fc3003dd27707ceae0ce7 (HEAD -> developer, kumar/multiply)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 20:33:17 2021 +0530
    
        added multi.py
    
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    
    

     

     

    And if we come to the master branch then you can see here that there is no multi.py file in the master branch because the master branch and other branch does not know what the developer branch is doing.
    There is no multi.py file. .




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> sudo git checkout master
    Switched to branch 'master'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git log
    commit e584eac2994d004ddfc1ce89f4d235bb25b9682c (HEAD -> master)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:38:29 2021 +0530
    
        added message in add.py
    
    commit 744a177504dd38541098ea79a5bb8feb982442f4
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:15:00 2021 +0530
    
        added message in add.py
    
    commit 62ca770ab7c38abccb8f456900a47a55b05c3bf5
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:06:28 2021 +0530
    
        adding atul.py
    
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     



    Now we merging all branch and file in one master branch.

    There is no multi.py file.

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git merge developer
    Updating e584eac..fe6515e
    Fast-forward
     multi.py | 6 ++++++
     1 file changed, 6 insertions(+)
     create mode 100644 multi.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git log
    commit fe6515e67a1b9015626fc3003dd27707ceae0ce7 (HEAD -> master, kumar/multiply, developer)
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 20:33:17 2021 +0530
    
        added multi.py
    
    commit e584eac2994d004ddfc1ce89f4d235bb25b9682c
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:38:29 2021 +0530
    
        added message in add.py
    
    commit 744a177504dd38541098ea79a5bb8feb982442f4
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:15:00 2021 +0530
    
        added message in add.py
    
    commit 62ca770ab7c38abccb8f456900a47a55b05c3bf5
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 07:06:28 2021 +0530
    
        adding atul.py
    
    commit e910f6b5f1208c697329ed4207d8cd57e598ee77
    Author: Kumar Atul Jaiswal <kumaratuljaiswal222@gmail.com>
    Date:   Sat Jun 5 06:38:00 2021 +0530
    
        initial commit
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    Now we want that there should be some such file which git is not able to track, it should not go to 'git echo system' So for this we can keep the file inside gitignore.

    This is a secret hash-key and I want that it should not be exposed or uploaded on GitHub because someone can misuse it, it is only for us developers to use in our project.

    .




    by command

    touch .gitignore

     

     


     

     

     

     

         hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            .gitignore
            key.py
    
    nothing added to commit but untracked files present (use "git add" to track)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
         
         

     

     

    I want that it should not be exposed or uploaded on GitHub so type file name (key.py) inside .gitignore file .





    and as you can see the file is hidden and git is not able to track.



     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git status
    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            .gitignore
    
    nothing added to commit but untracked files present (use "git add" to track)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    and if you want hidden .gitignore file also and even git is not able to track.





     

    Now we talk about github 

     

     


     

    first of all we will create a new repo in github

     


     

     


    And as soon as the repository is created it will ask you to setup what you want to do, do you already have a repo or do you want to create.
     

     


     

     

    we have already a repo so that's why we using this setup...

     

     

     

     

     

    """
    …or push an existing repository from the command line
    
    git remote add origin https://github.com/whoiskumaratul/learn-git.git
    git branch -M main
    git push -u origin main
    
    """
    

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git remote -v
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git remote add origin https://github.com/whoiskumaratul/learn-git.git
    [sudo] password for hackerboy: 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git remote -v
    origin  https://github.com/whoiskumaratul/learn-git.git (fetch)
    origin  https://github.com/whoiskumaratul/learn-git.git (push)
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    

     

     

    if some type of error are coming, dont worry!!!



     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git branch -M master
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> git push -u origin main
    error: src refspec main does not match any
    error: failed to push some refs to 'https://github.com/whoiskumaratul/learn-git.git'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master) [1]> 
    
    

     

     

    so don't worry type this command and give a username and password of github account.




     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git push -u origin master
    Username for 'https://github.com': whoiskumaratul
    Password for 'https://whoiskumaratul@github.com': 
    Enumerating objects: 15, done.
    Counting objects: 100% (15/15), done.
    Delta compression using up to 4 threads
    Compressing objects: 100% (13/13), done.
    Writing objects: 100% (15/15), 1.42 KiB | 242.00 KiB/s, done.
    Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
    remote: Resolving deltas: 100% (1/1), done.
    To https://github.com/whoiskumaratul/learn-git.git
     * [new branch]      master -> master
    Branch 'master' set up to track remote branch 'master' from 'origin'.
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     

    after refreshing the page as you can see all files are uploaded.

     





     


     

    But if you want to add new file via command line as we have been doing so far

    let's create new file called as color.py 


     


     

     

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git add color.py
    [sudo] password for hackerboy: 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git commit -m "added color.py"
    [master f3dc945] added color.py
     1 file changed, 10 insertions(+)
     create mode 100644 color.py
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)                                                                                              hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git push -u origin master 
    Enumerating objects: 4, done.
    Counting objects: 100% (4/4), done.
    Delta compression using up to 4 threads
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 565 bytes | 282.00 KiB/s, done.
    Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
    To https://github.com/whoiskumaratul/learn-git.git
       fe6515e..f3dc945  master -> master
    Branch 'master' set up to track remote branch 'master' from 'origin'.
    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> 
    
    

     

     


     

     


    Now, we adding a developer branch

    sudo git checkout developer
    sudo git push -u origin developer

     

     

    hackerboy@KumarAtulJaiswal ~/D/learn-git (master)> sudo git checkout developer
    Switched to branch 'developer'
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> sudo git push -u origin developer
    Username for 'https://github.com': whoiskumaratul
    Password for 'https://whoiskumaratul@github.com': 
    Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
    remote: 
    remote: Create a pull request for 'developer' on GitHub by visiting:
    remote:      https://github.com/whoiskumaratul/learn-git/pull/new/developer
    remote: 
    To https://github.com/whoiskumaratul/learn-git.git
     * [new branch]      developer -> developer
    Branch 'developer' set up to track remote branch 'developer' from 'origin'.
    hackerboy@KumarAtulJaiswal ~/D/learn-git (developer)> 
    
    
    

     

     

     




     

     


    How to collaborate with multilple users ?


    if you want multiple users and developers to work on one project so you need to use open source.
     

    First you make the project open source and then people fork on that project and after that make some changes in it and send pull request.

    and second one is you need to add other person that who some changes and modified in project with collaborate.




    go to setting --> manage access --> add your collaborater --> and wait for the invitation to be accepted.
     

     



     

     invitation accepted Vola!!!!

     

     


     

     

     

     
     
     
     
     



     

     

     

    now I am going to my own account ( whoiskumaratul ) repo with 2nd account ( hackingtruthin )
     

     



     

    now i want to add some contribution as a hackingtruthin account. so first i need to fork of whoiskumaratul repo

     

     




    successfully forked




     

     

     

    then i am going to in terminal and edit my own name and email as a hackingtruthin account...


    type-

    sudo git config --global --edit 

    and change name and email and then one directory backed and checkout master branch with sudo git checkout master.

    so if any error are coming when you change master branch, do dont' worry go ahead and type next command 

    ls

    nano README.md (file that i want to some changes it)

    cat README.md

    sudo git status  

    as you can see this, modified file available here,so let's add and commit

    sudo git add README.md

    sudo git commit -m "readme.md updated"

    sudo git push

     

     

     

    hackerboy@KumarAtulJaiswal ~/Desktop (master)> 
    hackerboy@KumarAtulJaiswal ~/Desktop (master)> 
    hackerboy@KumarAtulJaiswal ~/Desktop (master)> sudo git config --global --edit
    hackerboy@KumarAtulJaiswal ~/Desktop (master)> 
    hackerboy@KumarAtulJaiswal ~/Desktop (master)> cd Lets-Contribution
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> sudo git checkout master
    error: pathspec 'master' did not match any file(s) known to git
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main) [1]> 
    
    
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main) [1]> ls
    README.md
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> nano README.md 
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> cat README.md 
    # Lets-Contribution
    This is my first contribution and wait
    file will be updated...
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> 
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> sudo git status
    On branch main
    Your branch is up to date with 'origin/main'.
    
    Changes not staged for commit:
      (use "git add <file>>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   README.md
    
    no changes added to commit (use "git add" and/or "git commit -a")
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> sudo git add README.md
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> sudo git commit -m "readme.md updated"
    [main 1831fb8] readme.md updated
     1 file changed, 1 insertion(+), 1 deletion(-)
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> sudo git push
    Username for 'https://github.com': hackingtruthin
    Password for 'https://hackingtruthin@github.com': 
    Enumerating objects: 5, done.
    Counting objects: 100% (5/5), done.
    Delta compression using up to 4 threads
    Compressing objects: 100% (2/2), done.
    Writing objects: 100% (3/3), 271 bytes | 271.00 KiB/s, done.
    Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
    remote: Resolving deltas: 100% (1/1), completed with 1 local object.
    To https://github.com/hackingtruthin/Lets-Contribution.git
       6b5ddf9..1831fb8  main -> main
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> 
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> 
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> ls
    README.md
    hackerboy@KumarAtulJaiswal ~/D/Lets-Contribution (main)> 
    

     

     

     

    in actual repo...he doesn't know about this...



     

     
     
     
    readme.md file has been updated and here you can see 3 commits showing

     
     






    The change can be added to the file of the Open by the Open Pull request.




     
     
     
     

    create pull request,

     

     


     

     

     

     

     


     

    Here you can give your message that you have changed the file

     

     

     


     

     

    and finally pull request submitted. After this, the owner will now check that the change made by you should be added to it in your project or not

     

     

     


     

     

     

    now what i see, i have to come a new pull request

    so let's check it. open request option and as you can see here are 1 pull requests

     





     

     

     

     


     

     

     

    then i check to what changes by them..

    go to file changes option

     

     

     

     


     

     


    then review and approve.


     

     

     


     

     

     

    and then i submitted with appreciation message.

     

     

     


     

     

     

     

     
    then merge pull request and confirm it


     

     





    and go back to our account whoiskumaratul
    and check readme.md file






      

     

     


    then if we going to commit section, here you can see what changes made by someone or ownself.
     

     




     

     

    So in the same way you can modify, delete, add new file, features someone's project added by these steps
    same repeate


    fork
    clone
    changes
    push
    pull request



     

     



    Disclaimer

     

    This was written for educational purpose and pentest only.
    The author will not be responsible for any damage ..!
    The author of this tool is not responsible for any misuse of the information.
    You will not misuse the information to gain unauthorized access.
    This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


    All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


    All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



    - Hacking Truth by Kumar Atul Jaiswal



    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)

     

     


  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.