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

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

本站已经建立2583天!

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