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

本站现有博文324篇,共被浏览819963

本站已经建立2524天!

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