Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Wednesday, 20 May 2020

Some commonly used git and GitHub stuff, including links to guides etc.

https://wiki.eclipse.org/EGit/User_Guide

https://netbeans.org/kb/docs/ide/git.html

https://code.visualstudio.com/docs/editor/versioncontrol

https://www.jetbrains.com/help/pycharm/version-control-integration.html

https://helpx.adobe.com/uk/dreamweaver/using/git-support.html

https://desktop.github.com

Below are some common git commands;

To checkout a file or folder on svn;

svn checkout http://192.168.8.5/mcc/mccweb mccweb

where the entire contents of mccweb will be create in a directory called mccweb. You need not create the directory beforehand.

To initialize a local repository;

git init

To add files to the repository;

git add .

To add a file to the repository;

git add filename
 

to commit said files;

git commit -m "some comment"

 
Or alternatively on svn;

 
svn add filename

svn commit -m "some comment"
svn commit myFile -m "some comment"

To remove files from repository;

git rm --cached file

To exclude files, edit;

.git/info/exclude

and add *.txt for example, to exclude txt files.

OR

add a .gitignore file with similar contents



To add a GitHub remote repository, do;

git remote add origin url

where url is the git url, example: https://github.com/user/name.git

To verify this, do;

git remote -v 


To push changes, do

git push remote name branchname

example; git push origin master

where origin is the remote name and master is the branch

To push to a different branch name, do;

git push origin master:newBranchName

where origin is the remote name and master is the branch, with newBranchName being the new branch name on the remote.

Example (specifically for submitting Harvard X programming sets);

git push origin master:games50/assignments/2020/x/0 

so origin is my remote name, master is my local branch and assignments/2020/x/0 is the new branch name on the remote.





Also found this quite useful;



and










No comments:

Post a Comment

Note: only a member of this blog may post a comment.