EVE-NG Linux VM SSH troubleshooting
September 20, 2025
Advanced Git commands
In the last two posts, we covered most of the essential Git features. Now, let’s dive into some additional functionalities that might come i
In the last two posts, we covered most of the essential Git features. Now, let’s dive into some additional functionalities that might come in handy.
.gitignore
The .gitignore file is used to specify which files or directories should never be included in your Git repository. This file is tailored to each repository and typically excludes:
- Cache files
- Compiled files
- Temporary files
- Password files
You can either start with GitHub’s suggested templates or create your own using the correct format .
Stashing your work
Sometimes you need to put aside your current work to focus on something more urgent. If you’ve made changes but aren’t ready to commit, switching branches won’t work because Git doesn’t know how to handle uncommitted changes.
This is where stash comes in. It saves all your changes, including those staged for commit, and allows you to retrieve them later:
Now you can safely switch branches. To retrieve the stashed changes later:
You can also list all stashed changes with:
Deleting Remote Branches
While local branches can be deleted with the branch command, deleting a remote branch involves a push:
Rebase
Rebase lets you integrate changes in a way similar to merge, but it reapplies a series of commits starting from a different base, effectively rewriting the history of the repository. Be cautious, this can cause inconsistencies, especially in public repos where multiple people collaborate.
For example, in a repo with main and branches fix3 and fix4 waiting to be merged:
If we merge the fix3 branch, we notice that the commit IDs have been preserved:
Continue reading the post on Patreon .