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

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

本站已经建立2544天!

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