# set git variables
git config --global user.name "<your name>"
git config --global user.email "name@email.com"
# query the value of user.name
get config user.name
git clone https://github.com/apache/spark.git
cd spark
# create git repository on the client
mkdir myRepos
cd myRepos
git init
# create a file
touch README.md
# add the file into the client repository
git add README.md
# record changes to the client repository
git commit -m "my changes"
# add a remote
git remote add origin https://github.com/apache/spark.git
# Deliver client changes to the server repository
git push -u origin master
We are using a simplified version of Gitflow workflow. Here is some information about Gitflow:
High-level tutorial from Atlassian Original blog about Gitflow
git remote show origin # Check your configuration before starting
git status # Use this command frequently
git checkout -b new-branch-name develop # Creates a new local branch based on develop
git add README.md # Add your changed files to the staging area
git diff --staged # Compares the staging area to your local repo
git commit -a # Commits changes in staging area to local repo
git log --name-status --since=2.days # Make sure the history looks as expected
git show <hash of your commit> # View details of your commit
git diff --name-status new-branch-name develop # View diff between your feature branch and local develop
git push -u origin new-branch-name # Pushes whole branch to central repo
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有