本機建立Git目錄
1.在本機建立新目錄gitworkspace,並且初始化git init後,新增一個 main.sh檔
#!/bin/bash
main() {
echo "This is the main branch."
}
main "$@"
git checkout -b feature
#!/bin/bash
main() {
echo "This is the feature branch."
echo "Adding user registration feature."
echo "Validating user input."
echo "Styling the registration form."
}
main "$@"
添加更改到暫存區
git add
提交更改,並提供描述
git commit -m "Add feature branch "
註冊或登入Gitlab
1.new project/repository,Create blank project
2.Push an existing Git repository,在本機輸入下面二行指令,使本機和遠端的Gitlab進行同步。
git remote add origin https://gitlab.com/maline3838/gitworkspace.git
git push --set-upstream origin –all