当前位置: 首页 > 工具软件 > kbee.workflow > 使用案例 >

GitHub Workflow

司徒高丽
2023-12-01

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
 类似资料:

相关阅读

相关文章

相关问答