henryliangt / usyd

0 stars 0 forks source link

Git #63

Open henryliangt opened 12 months ago

henryliangt commented 12 months ago
cd path/to/your/project
git init

list all and check all the branches

git branch -a if no branches, create one git checkout -b main

git add .
git commit -m "Initial commit"

Go to your GitHub repository (https://github.com/your-username/sjtu). Copy the repository URL.

git remote add origin <repository-url>

git push -u origin master username&password or token git clone <repository-url> username&password or token

henryliangt commented 12 months ago

Token Using a Personal Access Token (PAT):

  1. Go to your GitHub account settings.
  2. In the left sidebar, click on "Developer settings."
  3. Click on "Personal access tokens."
  4. Click "Generate token" and provide the necessary permissions (at least repo for private repositories).
  5. Copy the generated token.

git config --global user.email 'xxx@gmail.com' git config --global user.name 'hl'

git config --global credential.helper store This command configures Git to store credentials in plaintext on the disk.

git push git clone https://github.com/henryliangt/xxx.git

GitHub username -> Instead of entering the password, use the personal access token you generated.

henryliangt commented 12 months ago

Ubuntu Commit

git remote set-url origin https://:@github.com/your-username/sjtu.git

henryliangt commented 12 months ago

pull

cd sjtu
git clone <repository_url> .
git clone https://github.com/your-username/sjtu.git .

if username wrong: git config --global credential.helper store update credential in local files. for convenience.

or Git Credential Manager for Windows

Git Credential Manager Core for cross-platform support.

git pull origin main

henryliangt commented 12 months ago

commit changes

git add . git commit -m "Your commit message here" git push origin main

henryliangt commented 12 months ago

changes happen,then

check changes:

git log
git log --oneline
git log -p      ( "q" to stop showing more)
cd
git pull origin main
henryliangt commented 12 months ago
pip install -r r.txt
pip freeze > r.txt

pip install --upgrade pip
pip cache purge
pip install -r requirements.txt
henryliangt commented 12 months ago
conda install -c conda-forge --file requirements.txt
conda install --file requirements.txt
conda list

conda install --file r121.txt --exclude="argon2-cffi"

conda create -n myenv --file r.txt

conda list --export --no-builds | grep -v "prefix:" > requirements.txt

henryliangt commented 12 months ago

git config --global core.autocrlf true git config --local core.eol lf

git clone https://github.com/your-username/your-repo.git

henryliangt commented 12 months ago

pip install pipdeptree

pipdeptree --warn silence --warn silence --warn silence --warn silence --warn silence -f --warn silence --warn silence | grep -E '^\S' > requirements.txt

pip install -r r.txt