Skip to main content

GIT

 

To share this code with your teammates, you’ll want to create a shared Git repository that you can all access. One way to do this is to use GitHub. Head over to github.com, create an account if you don’t have one already, and create a new repository. Configure your local Git repository to use the new GitHub repository as a remote endpoint named origin as follows:
git remote add origin git@github.com:<YOUR_USERNAME>/<YOUR_REPO_NAME>.git
git push origin main
git pull origin main

# Create local repo server
#git init --bare 

change remote repo url:
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
# Change the 'origin' remote's URL

git remote -v
# Verify new remote URL
# origin  https://github.com/user/repo2.git (fetch)
# origin  https://github.com/user/repo2.git (push)

Git reset & revert:
# restore and revert:

#git log --oneline
#git revert commit_hash

#git restore -s commit_hash file(s)
#git reflog

https://www.atlassian.com/git/tutorials/learn-undoing-changes-with-bitbucket

Comments

Popular posts from this blog

Cheat Sheet

Bash: echo $? - exit status of last command (0 no error) ' - Single quote removes meaning special meaning of special character. find /qwe -type f -iname *.js -exec cp --parents -t /tmp/ {} + -- find all js files and copy with parent directory ystemctl set-default graphical.target (ls -l /lib/systemd/system/runlevel*) -- set runlevel echo <password> | sudo -S for i in t@01 st@02 ba@sta03;do ssh -o RequestTTY=true $i "sudo -l";done -- allow tty present VIM: :r! sed -n '16,812 p' < input_file.txt -- copy line range from input_file :1,10d -- delete line from 1 to 10 :se nu -- show line numbers Apache: Redirection in Apache (By default, the Redirect directive establishes a 302, or temporary, redirect.): URL:https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache-and-nginx <VirtualHost *:80> ServerName www.domain1.com Redirect 301 /oldlocation http://www.domain2.com/newlocation </VirtualHo...

Salt -- cheat sheet

      The Salt system is a Python-based open-source remote execution framework for configuration management, automation, provisioning and orchestration.  A basic Salt implementation consists of a Salt master managing one or more Salt minions.