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

本站现有博文332篇,共被浏览882759

本站已经建立2588天!

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