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

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

本站已经建立2719天!

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