Computer Notes/GIT: Difference between revisions

From Cramsession
Jump to navigationJump to search
✍️ Verified Author: MflavellClick to view professional profile & credentials
(Created page with "= Setting up a private GIT repo in linux = Generate an SSH key: ssh-keygen -t ed25519 -C "your_email@example.com" '''The email must match your github email!!!''' Start the SSH agent & Add your key: eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 Copy the public key: cat ~/.ssh/id_ed25519.pub Add the key to github: ::* Go to Settings -> SSH and GPG keys -> New SSH Key. ::* Give it a title (like "Linux Desktop"), paste the key into the field, and save....")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 30: Line 30:


   git clone git@github.com:username/private-repo.git
   git clone git@github.com:username/private-repo.git
= The git process =
** Clone the repo
** Add / Modify files > git add (add the files you want to submit)
** git status (Double check list)
** git commit (saves locally)
** git push (upload changes)
= Useful commands =
====Add the a folder to git====
git add '''path'''
====Remove something that is staged====
git restore --staged '''path'''
====Check what is staged====
git status
====Commit the changes====
git commit -m “Message for commit”
or to amend a commit
git commit –amend -m “Message for commit”
====Uploading changes====
git push
[[Computer Notes/GIT/Git Cheat Sheet|Git Cheat Sheet]]

Latest revision as of 17:08, 31 August 2026

Setting up a private GIT repo in linux

Generate an SSH key:

ssh-keygen -t ed25519 -C "your_email@example.com"

The email must match your github email!!!


Start the SSH agent & Add your key:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519


Copy the public key:

cat ~/.ssh/id_ed25519.pub


Add the key to github:

  • Go to Settings -> SSH and GPG keys -> New SSH Key.
  • Give it a title (like "Linux Desktop"), paste the key into the field, and save.


Clone what you need:

 git clone git@github.com:username/private-repo.git


The git process

    • Clone the repo
    • Add / Modify files > git add (add the files you want to submit)
    • git status (Double check list)
    • git commit (saves locally)
    • git push (upload changes)


Useful commands

Add the a folder to git

git add path


Remove something that is staged

git restore --staged path


Check what is staged

git status


Commit the changes

git commit -m “Message for commit”

or to amend a commit

git commit –amend -m “Message for commit”

Uploading changes

git push


Git Cheat Sheet