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

本站现有博文333篇,共被浏览925543

本站已经建立2632天!

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