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

本站现有博文328篇,共被浏览858459

本站已经建立2567天!

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