- Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or _gitignore
- remember to add the appropriate .gitignore file
- Open Git Bash
- Change the current working directory to your local project.
- Initialize the local directory as a Git repository.
$ git init
- Add the files in your new local repository. This stages them for the first commit.
$ git add .
- Commit the files that you've staged in your local repository.
$ git commit -m "First commit"
- At the top right of the GitHub repositoryclick on Clone or Download and then click the
to copy the remote repository URL.
- In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
$ git remote add origin THE_URL_YOU_COPIED
$ git remote -v
- Push the changes in your local repository to GitHub.
$ git push origin master
$ git fetch
The coomand below will fetch all the remote branches.
$ git branch -v -a
remotes/origin/test
Branches stating with remotes/* are branches on the server. With the switch command below it is possible to checkout the romote branch
$ git switch test
In case of multiple remotes see article below https://stackoverflow.com/questions/1783405/how-do-i-check-out-a-remote-git-branch
git fetch --all
Then, you have two options:
git reset --hard origin/master
OR If you are on some other branch:
git reset --hard origin/<branch_name>
Before proceeding, make sure all your changes are committed, including your .gitignore file.
To clear your repo, use:
git rm -r --cached .
rm is the remove command -r will allow recursive removal –cached will only remove files from the index. Your files will still be there. The . indicates that all files will be untracked. You can untrack a specific file with git rm --cached foo.txt (thanks @amadeann). The rm command can be unforgiving. If you wish to try what it does beforehand, add the -n or --dry-run flag to test things out.
git add .
git commit -m ".gitignore fix"
git clean -f
git clean -fd
git clean -fX
git push origin master
you now have a clean repo!
Install Jupyter if you don't have it
pip install notebook
launch Jupyter
python -m notebook
git add .
git commit -m "YOUR COMMENT"
git push origin master
conda create --name YOUR_ENV_NAME python=3.11.3
conda env list
conda deactivate
conda remove --name YOUR_ENV_NAME --all
conda create --name YOUR_NEW_ENV_NAME --clone YOUR_SOURCE_ENV_NAME
conda rename -n YOUR_ACTUAL_ENV_NAME YOUR_NEW_ENV_NAME
git fetch
git merge origin/master
optianlly use
git reset --hard
if you got an error and you want your local changes to be overwritten
ls -lah
-l Long listing. Possibly the most used option for ls. -a By default, ls does not list files whose name that start with a dot (such as for example .profile etc). This flag causes such files to be included. -h With -l or -s: prints sizes human readable (for example 1.89G or 815M, same idea as also tree -h). https://renenyffenegger.ch/notes/Linux/shell/commands/ls/