Introduction :
Whether you're a seasoned developer or just starting your coding journey, having a handy cheat sheet of essential commands can be a real lifesaver. In this comprehensive guide, we've compiled a well-articulated and documented list of Linux, Git, and GitHub commands, along with brief explanations of their usage. So, let's dive right in and supercharge your coding experience! ๐ป๐
Linux Commands ๐ง:
ls - List files and directories. Usage:
ls [options] [directory]
Example:ls -l
cd - Change the current directory. Usage:
cd [directory]
Example:cd Documents
mkdir - Create a new directory. Usage:
mkdir [directory_name]
Example:mkdir my_folder
rm - Remove files or directories. Usage:
rm [options] [file/directory]
Example:rm -rf my_folder
cp - Copy files or directories. Usage:
cp [options] [source] [destination]
Example:cp file.txt /new_location
mv - Move or rename files/directories. Usage:
mv [options] [source] [destination]
Example:mv file.txt new_name.txt
pwd - Print the current working directory. Usage:
pwd
grep - Search for patterns in files. Usage:
grep [options] [pattern] [file]
Example:grep "keyword" file.txt
Git Commands ๐:
git init - Initialize a new Git repository. Usage:
git init
git clone - Clone a repository to your local machine. Usage:
git clone [repository_url]
Example:git clone
https://github.com/username/repository.git
git add - Add changes to the staging area. Usage:
git add [file]
Example:git add file.txt
git commit - Commit staged changes. Usage:
git commit -m "Commit message"
Example:git commit -m "Add new feature"
git pull - Fetch and merge changes from a remote repository. Usage:
git pull [remote] [branch]
Example:git pull origin main
git push - Push local commits to a remote repository. Usage:
git push [remote] [branch]
Example:git push origin main
git branch - List, create, or delete branches. Usage:
git branch [options] [branch_name]
Example:git branch new_feature
GitHub Commands ๐:
git remote - Manage remote repositories. Usage:
git remote [options] [add/remove/show] [name] [url]
Example:git remote add origin
https://github.com/username/repository.git
git fork - Fork a repository on GitHub. Usage:
git fork
git pull-request - Create a pull request on GitHub. Usage:
git pull-request
Example:git pull-request -m "Fix typo"
git merge - Merge changes from one branch to another. Usage:
git merge [source_branch]
Example:git merge feature_branch
git checkout - Switch between branches. Usage:
git checkout [branch_name]
Example:git checkout develop
git log - Display commit history. Usage:
git log [options]
Example:git log --oneline
Conclusion :
Congratulations on completing our Ultimate Cheat Sheet for Linux, Git, and GitHub commands! You've now armed yourself with a powerful tool that will undoubtedly boost your productivity and efficiency as a developer. By mastering these commands, you're well-equipped to navigate the Linux terminal, manage version control with Git, and collaborate seamlessly on GitHub projects.