EADST

Git Branch Setup, Upload, and Tag Management

A quick guide to managing Git branches and tags for project releases.

Branch Setup and Upload

Creating a New Branch

git checkout -b feature-branch

Uploading Local Project to Remote Repository

git init # Initialize git repository
git remote add origin https://your-repo-url.git # Add remote repository
git checkout -b your-branch-name # Create and switch to branch
git add .  # Stage all files
git commit -m "Initial commit" # Commit changes
git push -u origin your-branch-name  # Push branch to remote

Tag Management

Creating Tags

git tag v1.0.0  # Create lightweight tag
git tag -a v1.0.0 -m "Release version 1.0.0"  # Create annotated tag with message
git tag v1.0.0 commit-hash  # Tag specific commit

Pushing Tags

git push origin v1.0.0  # Push single tag
git push origin --tags  # Push all tags

Managing Existing Tags

git tag -d old-tag-name   # Delete local tag
git push origin --delete old-tag-name  # Delete remote tag
git tag new-tag-name old-tag-name  # Rename tag (delete old, create new)
git tag -d old-tag-name
git push origin --delete old-tag-name
git push origin new-tag-name

Branch and Tag Relationship

Key Points: - Tags point to specific commits, not branches - Tags are created on the current HEAD commit - Use git branch --contains tag-name to see which branches contain a tag

Best Practices

git checkout main
git tag v1.0.0
git push origin v1.0.0
git show v1.0.0  # Check tag location
git branch --contains v1.0.0

Common Workflow Example

git init  # 1. Setup project
git remote add origin https://repo-url.git

git checkout -b feature/new-functionality # 2. Create feature branch

git add . # 3. Work and commit

git commit -m "Add new functionality" git push -u origin feature/new-functionality # 4. Push branch

git checkout main # 5. Merge to main and tag release git merge feature/new-functionality git tag v1.0.0 git push origin main git push origin v1.0.0

Useful Commands

git branch -a  # List all branches
git tag -l  # List all tags
git show tag-name  # View tag details
git branch --show-current  # Check current branch

Tags are essential for marking release points and maintaining version history, while branches organize development work efficiently.

相关标签
Git
About Me
XD
Goals determine what you are going to be.
Category
标签云
Firewall Website GIT llama.cpp Proxy Use Conda Docker Windows NLTK PyCharm Bipartite FP16 Card Shortcut SVR CC Hilton scipy Python VGG-16 Tiktoken 图形思考法 Password Attention API Algorithm BeautifulSoup Dataset OpenAI Template 域名 v0.dev Pytorch 签证 Pillow Google EXCEL 顶会 VPN mmap C++ Base64 YOLO Vim TTS FP32 WebCrawler Github Interview MD5 Plotly Vmess Quantization Claude Magnet SQLite uWSGI Transformers BTC Tensor Search logger CEIR SAM RAR CUDA Crawler 证件照 Ubuntu Image2Text 算法题 论文速读 音频 Domain Baidu Permission Statistics Distillation Rebuttal 多进程 Excel Cloudreve DeepSeek Qwen2.5 PDB Diagram Clash Data ChatGPT GGML Mixtral Bin ms-swift 强化学习 Michelin VSCode torchinfo Django FP8 CTC ResNet-50 报税 图标 Video Freesound Color Random IndexTTS2 GoogLeNet Input HaggingFace Breakpoint WAN HuggingFace Sklearn Zip API网关 Nginx XGBoost Streamlit 净利润 Augmentation Heatmap OpenCV Jev FastAPI 递归学习法 tar RL Harness Paper Safetensors Qwen2 Bitcoin Agent Bert Linux Knowledge 第一性原理 Ptyhon TSV printf git-lfs CV Translation PDF LeetCode 版权 CSV Numpy Datetime Animate Plate 飞书 LoRA Land 云服务器 JSON diffusers FP64 LaTeX AI DeepStream Markdown UI QWEN CLAP InvalidArgumentError Quantize Math BF16 Pickle XML Git uwsgi LLM hf v2ray ModelScope NameSilo SPIE Gemma Miniforge LLAMA icon Web GPTQ transformers FlashAttention Paddle OCR PyTorch 财报 NLP 阿里云 Hotel PIP 多线程 Llama Anaconda Qwen tqdm TensorRT TensorFlow Disk 搞笑 GPT4 腾讯云 RGB UNIX Review CAM Pandas SQL 继承 Tracking Food git Jupyter Hungarian 论文 COCO Logo ONNX 公式 关于博主 Jetson News
站点统计

本站现有博文338篇,共被浏览987281次

本站已经建立2699天!

热门文章
文章归档
回到顶部