Skip to content

matteoamorth/git-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git management from terminal

Generic setup

  1. install git on pc
  2. create shh-keygen on pc
  3. upload to github profile
  4. clone repos with shh method (allows pushes)
  5. open folder in vscode and save changes

Push files to origin

git add . 
git commit -m "Some description of update" //describe the changes 
git push //add files to origin

Push specific branch

git push origin develop

Add files in a branch to the main

git push origin develop:main

Push only specific folders or files

git add my_folder
git add README.md

Push files that already have been edited online

Error sample:
 ! [rejected]        main -> main (fetch first)
error: push di alcuni riferimenti su 'github.com:matteoamorth/git-test.git' non riuscito

To force the commit:

git push --force origin main

Remove file

To remove file "file_tmp.txt" in "my_folder"

git rm ./my_folder/file_tmp.txt

Remove all

git rm -r --cached .

Pull files

git pull
git pull --force

Check changes:

git fetch

Branches

Look current branch and branches list

git branch

New branch

Create (forced)

git checkout -b develop

Switch branch

git checkout "name" 
git switch "name"

Exclude folders from branch

create file .gitignore

#FOLDER
your_folder/

#File extensions to discard
*.asv
*.bak
*.rst

About

A repo for git basic operations

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published