Coder Social home page Coder Social logo

gittutorial's Introduction

git&github

Git & Github

Git is a software used as a distributed version control system (VCS). It is utilized to track changes in software projects, manage different versions, and collaborate effectively. Git operates swiftly, flexibly, and reliably.

GitHub is a cloud-based platform built upon Git. It allows you to host, share, and collaborate on projects.


๐Ÿ’กBefore diving into Git usage, let's take a look at some essential terminal commands.

Here are some basic terminal commands:

  • ls: It lists the files and folders in the current directory.

  • ls -la: It lists the files and folders in the current directory in detail, showing permissions, owners, and other attributes of the files.

  • cd [directory]: It changes the directory to the specified one.

  • cd ..: It allows the user to move up one directory level from the current directory, effectively navigating to the parent directory.

  • mkdir [folder name]: It creates a new folder.

  • rmdir: It is used to delete the specified folder (directory). However, the folder must be empty. If there are files or subfolders inside the folder, the rmdir command will not work. If files or subfolders need to be deleted as well, the rm -rf command should be used.

  • touch [file name]: It creates a new file.

  • rm [file name]: It deletes the specified file.

  • cp [source] [destination]: It copies the source file to the destination location.

  • mv [source] [destination]: It moves the source file to the destination location.

  • cat [file name]: It prints the content of the file to the terminal.

  • grep [word] [file name]: It finds the lines containing the specified word.

  • chmod [permissions] [file name]: It changes the permissions of the file.

  • pwd: It shows the current working directory. You can use this command to find out in which directory you are located.

  • echo 'message' > [file name]: Writes a "message" containing text or a string of characters to the specified file.

  • nano [file name]: Used to open and edit a file.

These commands will suffice for basic terminal usage.

๐Ÿ‘‰ Now that we have covered the basic terminal commands, we can move on to Git commands.

Command Description
git config It is used to configure or view Git configuration settings.
git init It is used to initialize an existing directory as an empty Git repository.
git clone It is used to create a local copy from a remote Git repository.
git add It prepares the changes in the working directory to be tracked by Git.
git commit It saves the changes staged in the working directory to a local Git repository.
git diff It shows the differences between the working directory and the index, or between the index and the last commit.
git reset It is used to undo changes made in Git or to edit the index.
git revert Instead of reverting the changes of the previous commit, it allows creating a new commit to undo those changes.
git restore It is used to revert the contents of the working directory or specific files to their previous commit state or to change them.
git status It shows which files have been modified in the working directory, which ones are staged in the index, and which ones are awaiting commit.

gittutorial's People

Contributors

mces58 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.