What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2022-03-02 15:20:25
initialize a repo and push to github
git init git add . git commit -m "First commit" git remote add origin <remote repository URL> git remote -v git branch -M main git push -u origin main 1- # Create a new repository on GitHub. To avoid errors, do not initialize the new repo... Add solution -
Other 2022-02-25 02:40:22
sourcetree unable to authenticate PAT for Azure Dev ops
This is still the case in the SourceTree 3.2.0 Windows beta that is only a few days old. When trying to authorize with https://dev.azure.com/OrgName, it seems to succeed in logging in, but fail at gaining Git permissions. Swapping to https://OrgName.Visua... Add solution -
Shell/Bash 2022-01-31 11:00:25
rename a branch alredy pushed
1. Verify the local branch has the correct name: git branch -a 2. Next, delete the branch with the old name on the remote repository: git push origin ––delete old-name 3. Finally, push the branch with the correct name, and reset the upstream... Add solution -
Other 2022-01-28 05:11:01
Create new repo
# New local repository git init git add . git commit -m "Initial commit" # New remote repository # Create remote repository (likely on github), then: git remote add origin https://github.com/username/new_repo #https git remote add origin git@gi... Add solution -
Shell/Bash 2022-01-23 05:46:29
git branch from commit
# Create a new branch from previous commit's hash git branch develop 04c900c # Push the new branch to remote repository git push --set-upstream origin develop # Checkout the new branch git checkout develop Add solution -
Shell/Bash 2021-11-18 03:07:18
turn a folder into a git repo
# New local repository git init git add . git commit -m "Initial commit" # New remote repository # Create remote repository (likely on github), then: git remote add origin https://github.com/username/new_repo #https git remote add origin git@gi... Add solution -
Shell/Bash 2021-11-12 13:12:10
Change a branch name in a Git repo
# Start by switching to the local branch which you want to rename: git checkout <old_name> # Rename the local branch by typing: git branch -m <new_name> # At this point, you have renamed the local branch. # If you’ve already pushed th... Add solution -
Shell/Bash 2021-11-03 23:18:17
github repository's quick setup page
Open Terminal. 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 . # Adds the files in th... Add solution