...
If you haven’t already, download and install Git: https://git-scm.com/
Git should already be installed on Linux and MacOS.
Windows (Linux and MacOS users skip step): Set line endings.
Check:
git config --get core.autocrlf
If it is
true
orinput
, you do not need to set anything.
Set:
git config --global core.autocrlf [setting]
.--global
is optional, and replace[setting]
with eithertrue
orinput
When in doubt, use
input
Additional information here: https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf
Configure Git with your name and email: https://linuxize.com/post/how-to-configure-git-username-and-email/
--global
if you want to use it as the default, otherwise it will just be for the current repository.You can use your anonymous GitHub no-reply email.
Go to GitHub and navigate to your copy of the repository, under your account. Do not go to WARG’s copy of the repository!
Click on the green Code button.
In the dropdown, you can copy either the HTTPS or SSH link.
Windows and MacOS: Copy the HTTPS link (although you can copy the SSH link if you desire).
Linux: Copy the SSH link.
If you really want to use HTTPS on Linux, you have to install the Git Credential Manager or create a Personal Access Token on GitHub. How to do this is left as an exercise for the bootcamperyou.
If you’re using the SSH link (HTTPS link users skip this):
If you haven’t already, create a new SSH key and add it to your GitHub account:
If you add a password to your SSH key, you will have to type it in every time you use Git to interact with GitHub (e.g. cloning, pulling, pushing). You can always delete and create a new SSH key if you change your mind later.
Pick a parent directory to clone (download the code) into.
Example: Cloning in
C:\Users\Username\
will create a folder and then populate it:C:\Users\Username\autonomy-bootcamp-2023\[bootcamp stufffiles]
Open the console in the parent directory.
Windows: Command prompt or Powershell.
Linux and MacOS: Terminal.
RunClone the repository:
git clone [link you copied]
, where[link you copied]
is the link you copied in step 56.HTTPS link users: You will be prompted to log into your GitHub account. Do so.
Done!
...
If you haven’t already, activate the virtual environment:
Windows command prompt:
venv\Scripts\activate.bat
Windows Powershell:
.\venv\Scripts\Activate.ps1
Linux and MacOS:
source venv/bin/activate
You should now see
(venv)
in the prompt line.Code away! Run the tests! Please try to follow our style guide: Python Style GuideConvention
Ask questions if you need help!
Make a commit:
Check which files have changed:
git status
Run:
git add [files you changed]
, where[files you changed]
are the files you want to add to the commit.Use
git add .
if you want to add all of them (the dot means wildcard in Git).
Run:
git commit -m "Your commit message"
When you’re ready to push your latest commits to GitHub:
git push
No harm in doing this after every commit.
When you’re done, make sure to either close the terminal or run:
Windows command prompt:
venv\Scripts\deactivate.bat
Everything else:
deactivate
This is important to avoid going to a different project and then accidentally polluting your current project’s virtual environment.
...