# Initialize new repo
git init
# Connect to remote (GitHub/GitLab)
git remote add origin https://github.com/user/repo.git
# First push (sets upstream)
git push -u origin main# Create and switch to new branch
git checkout -b feature_branch
# Merge branches
git merge source_branch
# Delete local branch
git branch -d old_branch# Tag a release
git tag -a v1.0 -m "Release version"
# Revert to tag
git checkout v1.0- Identify conflicted files with
git status - Edit files to resolve conflicts
- Mark as resolved:
git add resolved_file
git commitgit checkout -b temp-branch # Save changes
git merge temp-branch main # Apply to main# Secure copy
scp file.txt user@remote:/path
# Bulk rename
rename 's/old/new/' *.txt# Find and kill process
pgrep -f "process_name" | xargs kill
# Persistent services
sudo systemctl enable service_name# Test connectivity
ping -c 4 google.com
# Check open ports
ss -tulnp# Interactive rebase (last 3 commits)
git rebase -i HEAD~3
# Amend last commit
git commit --amendgit submodule add https://github.com/user/repo
git submodule update --init --recursivePro Tip: Always
git pullbefore pushing to avoid conflicts!
Remember:--forcepushes should be used sparingly.
To add this to your repo:
1. Save the file as `deepseek_linux_tips.md` in your repo directory
2. Run:
```bash
git add deepseek_linux_tips.md
git commit -m "Add comprehensive Linux/Git tips file"
git push origin main
The file covers:
- All Git commands we've used
- Troubleshooting scenarios
- General Linux commands
- Best practices