Skip to content
Menu
e-lo [IT Engineer life]
  • Home
    • Note
  • Database
    • T-SQL
    • SQL Server quick
    • SQL server docs
    • MySql quick sheet
    • Postgre
    • InfluxDB
  • Programming
    • MS Azure Powershell
    • MS Azure Command-Line Interface (CLI) doc
    • Python Docs
    • Python Logging
    • Python-cheat-sheet
    • Git-guide
  • Azure
    • MS Windows virtual machines in Azure
    • MS ARM Docs
    • MS ARM Template Docs
    • MS ARM Functions
    • MS Bicep+ARM
    • MS ARM Tutorial
    • MS Deployment scripts (intern/extern)
    • MS Virtual Network
  • Az-nutshell
    • ms-technology-choices-compute-decision-tree
    • ms-data-store-decision-tree
    • ms-data-explorer
    • ms-storage-explorer
    • ms-azure-sql
    • ms-common-data-services
    • ms-azure-mysql-daas
    • ms-sla
    • az paas
    • az glossary-quicksheet
    • az-test-vm-script-quickguide
  • Linux
    • Top CMD’s
    • Useful CMD Linux
    • ss64 Linux
    • Ubuntu
    • 30 things Ubuntu 18.04
    • Bootable Ubuntu USB
    • LinuxFilesystemTreeOverview
  • Sys Admin
    • System Administrator
    • Sys News
  • Zen
    • Not thinking about anything is Zen
e-lo [IT Engineer life]

Github 101 + ssh

Posted on July 30, 2018September 20, 2021 by espenk

Commit and push to a newly created repository:

https://git-scm.com/docs

Navigate to folder with git cmd
Add the files in your new local repository. This stages them for the first commit.
Commit the files that you’ve staged in your local repository.
At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL. In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
Push the changes in your local repository to GitHub.

Conflict with commit to origin master?, do a pull before commit.

git config --global credential.helper wincred
git init
git add .
git commit -m "first commit"
git remote add origin remote_repos_url
git push origin master

git pull origin master

BASH VSC

Cloning a repository:

https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository

Navigate to where you want to store the repository:

cp the url and run:

git clone https://github.com/spawnmarvel/powershell-cmd.git

Do some code changes, here we added a new file:

Then run the below code and the repository is updated

git add .
git commit -m "from new pc"
git push origin master

Change repository and work more there:

cd..
cd t-sql
git add .
git commit -m "change dir"
git push origin master

Branch, if the branch “test” was created and we did some some changes

git branch

git add .
git commit - m "my commit"
git push origin HEAD:test

Merge

git checkout master
git merge --no-f test
git push origin master
or
git push origin test

Pull (will pull changes from the origin remote, master branch and merge them to the local checked-out branch)

git pull origin master

Merge conflicts

Did you get automatic merge failed; fix conflicts and then commit the result?
You did some updates local and someone did remote.

$ git pull origin master
From https://github.com/spawnmarvel/datasets-with-sqlserver-python
 * branch            master     -> FETCH_HEAD
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.

https://docs.github.com/en/github/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line

View merge conflicts

git status

If you get try to push a to big file i.e .bak for example use this cmd after you removed the file from the local repos (merged in previous commit and github rejected the push)

git lfs migrate import --include="*.csv"

Connecting to GitHub with SSH

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/checking-for-existing-ssh-keys

RSS Azure

  • Scale your cloud-native apps and accelerate app modernization with Azure, the best cloud for your apps May 24, 2022

RSS RabbitMQ

  • RabbitMQ 3.8.15 release

RSS Python

  • PEP 691: JSON-based Simple API for Python Package Indexes May 4, 2022

Tags

5 min (26) Ansible (1) ARM (10) azure (40) cmd (3) Django (4) Docker (1) e-lo (2) Flask (2) Github (9) Grafana (2) Information (7) Information Retrieval (13) JAVA (1) kivy (2) Kotlin (6) linux (15) mobile (2) Natural Language Prossesing (NLP) (2) Net.Core (1) Networking and Security (6) OPC (2) PEP8 (1) Philosophy (3) Python (47) Python Networking and Security (5) Reason (2) RMQ (3) Solr (11) Sql (10) Uncategorized (2) VSC (1) Warframe (2) WMVARE (4) Zabbix (7)

Recent Posts

  • 5 min Logic App Storage Table
  • 5 min Logic App PSQL
  • 5 min Logic App
  • 5 MIN Azure Data Explorer
  • TODO Build a Hash Table in Python With TDD Real Python

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Photo by Markus Spiske from Pexels "Matrix"

©2022 e-lo [IT Engineer life] | Powered by WordPress & Superb Themes