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

本站现有博文340篇,共被浏览1024243次

本站已经建立2720天!

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