sudo apt-get install git-core
Run the following commands to add a SSH Key to your SSH-agent so you can use git without logging in again and again. It is important that you stand in your home directory
Generates a new set of SSH-keys both private and public, it will ask you to create a password.
cd .ssh && ssh-keygen -t rsa -b 4096 -C "[email protected]"
Add your private SSH-Key to your computers ssh-mannager (if ssh-add does not work, run eval `ssh-agent -s`
ssh-add
Add your public SSH-key to GitHub
cat id_rsa.pub
Now copy the latest output and go to GitHub to add the public SSH Key to your account
Source: https://help.github.com/articles/generating-ssh-keys/
Also you can copy the local public key to remote server using this command:
ssh-copy-id -i id_ed25519.pub user@hostname
git clone [email protected]:Username/Repo.git
git add filename.sh // Adds everything to next push
git status // shows changes you are about to commit
git commit -m "Some Comment" // Prepare for push
git push // You are sending all chosen changes to your repository
git push origin master
git rm filemane // Removes file from repo on next push
git status // Shows changes you are about to commit
git commit -m "Removed some files" // Prepare for push
git push // you are sending all chosen changes to your repository
git pull
git diff origin/master..HEAD
git checkout -b branchname
git branch -d branchname
git checkout master
git merge branchname
git rebase -i HEAD~2
git push -f origin branchName
If you have commited and pushed file changes to remote and would like to revert the changes to this specifik file
git checkout HEAD~ -- path/to/file
git commit --amend -CHEAD
git push --force-with-lease origin <branchname>
git commit --amend -m "New commit message"
git push --force origin <branchname>