-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_commands.txt
59 lines (42 loc) · 2.61 KB
/
setup_commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
******** basic repo set up/ work flow guide ********
1. git clone [email protected]:naezzell/gadd.git
--> if you don't have ssh keys set up with github: https://help.github.com/en/enterprise/2.15/user/articles/adding-a-new-ssh-key-to-your-github-account
** This will create a directory called gadd. I recommend renaming it to your desired feature name, i.e. gadd-ibmsim if working on ibm simulator
2. git checkout dev
** this makes it so you are on dev branch instead of master
3. $ git checkout -b myfeature dev
** this creates a local branch called myfeature which forks off of dev
4. conda create -n gadd
** creates a conda environment called gadd
5. conda activate gadd
** activates gadd environment
--> now make sure you are in gadd directory with setup.py file
6. pip install -e .
** this builds the gadd package to your conda env while installing necessary dependencies like qiskit along the way
** building the package let's commands like:
from gadd import ibmsim
work from any directory so as long as your conda env is active
7. make code changes
** DO NOT make changes to same files at once. This causes merge conflicts. That's why we have feature branches... only work on feature that branch is related to.
8. git commit
** as you add features to myfeature, commit them and add comments regularly
-->Once you're satisfied with your feature, you can merge it to dev
9. git checkout dev
** puts you back on local copy of dev branch which is hosted remotely
10. git fetch origin dev
** this fetches any changes pushed to dev by other users (i.e. updates your local dev with remote changes)
11. git merge --no-ff myfeature
** merges changes on 'myfeature' branch to 'dev' branch locally
** btw, no-ff flag causes merge to always make new commit object which prevents loss of historical info about feature branch
--> after you are done with features, you want to delete local branch before pushing merged features to remote
--> this makes cleaner commit log history
12. git branch -d myfeature
13. git push origin dev
** this pushes altered features to remote
************ links to useful guides/ stackoverflow posts ************
1. https://nvie.com/posts/a-successful-git-branching-model/
2. https://stackoverflow.com/questions/15838192/best-way-to-manage-local-feature-branches-with-git
3. https://alex.dzyoba.com/blog/python-import/
4. https://stackoverflow.com/questions/49474575/how-to-install-my-own-python-module-package-via-conda-and-watch-its-changes
5. https://help.github.com/en/enterprise/2.15/user/articles/adding-a-new-ssh-key-to-your-github-account
6. https://help.github.com/en/github/using-git/getting-changes-from-a-remote-repository