Friday, August 16, 2024

Git

 git remote add origin https://<PAT>@github.com/<account>/<repo>.git

 

git init

git add .

commit -m "

 

git switch master

Or:

git checkout master 
 
git remote -v
# View existing remotes
# origin  https://github.com/user/repo.git (fetch)
# origin  https://github.com/user/repo.git (push)

git remote set-url origin https://github.com/user/repo2.git

 To check/get old values:

git config --global user.email
git config --global user.name
git config --global user.email '<git-commit-address>'
git config --global user.name yournewgoodname
git config --global --unset credential.helper
 
git config --list --show-origin 
 
//git make a ophan brnach and checkout
git checkout --orphan latest_branch

//git add all files
git add .

//git commit message
git commit -m "commit message"

//git delete your main/master brnach (if you have main write main instead of master everywhere below)
git branch -D master

//git rename your orphan latest_branch to master
git branch -m master

//git push damn everything
git push -f origin master 
 
git fetch repo_link branch
git add .
git commit -a -m "message"
git push origin master 

 

No comments:

Post a Comment