Version controlVersion control is fundamental in the world of software development. You can save your project during the entire working process, and you can return to an earlier stage if it is necessary. Furthermore, the version control allows the developers to work together on the same project. My choice was Git and GitHub for this purpose.
After you installed git successfully open your CLI or PowerShell!
$ git config --global user.name "username"
$ git config --global user.email "email"
Sign in/up GitHub!
Create new repository!
At the top of your GitHub site, click on the option "Repositories", then select "New". Add "Repository name" and "Description" if you like. Set "Private" if you want to choose who can see your repository (you can change it later). You can add readme file later as well. And finally, take the next steps:
$ cd /your-project-dir/
$ git init
$ git remote add origin /copy-your-repo-url-from-github/
$ git add .
"add ." means adding all files to repo from the selected folder. For example $ git add example1.py, example2.txt adding only this two.
Create a file with the name .gitignore
These are a few typical folders and files that you usually do not want to push.: __pycache__/, db.sqlite3, .env, Pipfile, Pipfile.lock. Files and folders in gitignore will not be pushed to the github repository. You can update these files only in your local project folder.
$ git commit -m "initial"
$ git push -u origin main
If everything went the right way, you could see your files on the GitHub repo now.
You are done now, you have got a GitHub repository. If you want to set up your repo anywhere, you should read the section below.
If you want to copy your repo to another folder or computer you should use the git clone command.
$ cd /your-destiny-dir/
$ git clone /repo-url/
$ pipenv install -r requirements.txt
If you get an error you should actualize the versions of packages in the text file. You can use ">=" which means later or equal version.
If you want the cloned repo as the basis of a new project (this is a skeleton project or something like this...), then you should delete the git folder (hidden by default) and initialize a new one. After all, you have to create a new repository and set the new repo's URL using the "git remote" command! Let's see:
Create a new repo on GitHub!
$ git remote set-url origin /new-repo-url/
$ git remote -v
You can check if your remote setting is working.