python
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
File -> Settings -> Project Interpreter -> Add Local -> New Environment -> Basic Interpreter -> 'Paste the Path' -> OK
source venv/Scripts/activate
pip3 install -r requirements.txt
deactivate
git fetch origin
git reset --hard origin/branch_name
git checkout -b name_branch
git push origin name_branch
git checkout master
git branch -d name_branch_local
git push origin --delete name_branch_remote
On your local branch
git branch --set-upstream-to origin/your_branch
On your master branch
git branch --set-upstream-to origin/master
Step 1: From your project repository, bring in the changes and test.
git fetch origin
git checkout -b name_branch origin/name_branch
git merge master
Step 2: Merge the changes and update on GitHub.
git checkout master
git merge --no-ff name_branch
git push origin master
Setup:
-
In the terminal/Shell, go to the directory where you want to place the team project, then use the following command to clone our project:
git clone https://github.com/sengfung27/Python-Online-Ordering-System.git
-
change directory to
microblog
then use the following command to see local branch:git branch
-
you should only see a master branch. Now, run following command to see all remote branch:
git branch -r
-
then fetch your own branch:
git fetch origin your_branch:your_branch
-
use
git branch
to see all local branch, you should see your branch and the master branch. -
go to your branch by doing
git checkout your_branch
, set upstream branch:git branch --set-upstream-to origin/your_branch
How to work?
-
Your branch belongs to your self, here is where you work. However, do not work on master branch. To switch to your branch. Use
git checkout your_branch
Usegit branch
to see where you are. -
When you finish a model (design and implementation, including testing), you have to merge your code to the develop branch, by doing the following things:
-
git checkout master
-
git pull
-
git merge your_branch
-
git push
. If conflict happen, solve conflict and commit, then dogit push
-