Using Git to Collaborate

While we just saw how Git can perform version control for your local files and how other users can download (or clone) copies of your Git repos on the same computer or across a network (LAN or Internet). Those users can then create commits periodically after making changes to the files in their cloned repo and push those changes back to your original repo.

Any computer running Git can clone a Git repo from any other computer running Git, regardless of the operating system used. There are many free sites you can use to host Git repos online, including GitHub and GitLab.

Let’s experiment with this using another user (root) on the same computer – the only requirement is that the other user has read/write access to your repo folder.

The following commands run by the root user (the other user) create a cloned copy of the myscripts repo (/home/jason.eckert/myscripts) within the root user’s home directory (/root) using the git clone command:

Look back at the output of the git status command from earlier, and you will notice it names you as the “On branch master.” A branch is simply a section of your Git repo, much like the different partitions on a hard disk.

Any changes you make to an original or cloned Git repo are part of the master branch by default. But you can create as many other branches as you like to store changes that you may want to experiment with. Once you are satisfied that the changes work as you expected, you can merge the changes you made in your branch with the files in the master branch.
More Info: comptia server+ salary

Comments

Popular posts from this blog

DDoS Attack Mean for My Security?

Profiling Hackers in the MITRE ATT&CK Navigator

The Importance of Post-Attack Analysis