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

本站现有博文323篇,共被浏览803496

本站已经建立2503天!

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