GitHub Workflow

Pull remote branch

  1. Create a new empty folder
  2. Initial
git init
  1. Create remote connection
git remote add origin https://gitee.com/XXXX.git
  1. Fetch remote branch to local
git fetch origin branch_name
  1. Create local branch and swift to this branch
git checkout -b local_branch_name origin/remote_branch_name
  1. Pull
git pull origin remote_branch_name

Push to remote branch

  1. git add .
  2. git commit -m “message”
  3. git pull origin remote_branch_name
  4. git push origin remote_branch_name

Create .gitignore before pushing

  1. touch .gitignore
  2. enter i to edit .gitignore

Example .gitignore for Vue projects:

.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
  1. Press esc to exit editing mode, enter “:wq” to save.

Note that if there are submissions already, we should remove cache before pushing again, or .gitignore would not be working.

git rm -r --cached .
git add . 
git commit -m 'update .gitignore'
git push origin remote_branch_name
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值