Crafting shortcuts and keeping it clean – advanced Git commands
While building your website, you might find yourself repeating some long Git commands. Wouldn’t it be easier to have shortcuts? Or to clean up unnecessary files with just a command? This section will cover some advanced commands that can do just that and more.
Working on your one-page portfolio website can sometimes feel like juggling. You’ve got new ideas you want to try, you’re fixing bugs, and at the same time, you’re keeping track of all the changes. Here are some Git commands that act like clever tools to help you juggle more efficiently.
- Creating your own shortcuts with git alias: Use
git config --global alias.[alias_name] [git_command]
to create shortcuts for commands you use often. For example, if you frequently check the status, you can set up an alias such asgit config --global
alias.st status
.Now, instead of typing
git status
each time, you just typegit st
:
...