-
Notifications
You must be signed in to change notification settings - Fork 0
Git Collaboration (CLI)
Kautilya Reddy edited this page Nov 30, 2024
·
2 revisions
This page is intended purely for internal documentation and MAY or MAY NOT be used for any of our submissions.
Here's a few steps for those unaware of how GitHub works
- Go To GitHub
- Sign-In
- On the Top Right Corner, Profile -→ Settings
- On the Left Pane, Developer Settings -→ Personal Access Tokens -→ Tokens(classic).
- Click on Generate New Token -→ Generate New Token(Classic)
- In the following Page: a. Give a name to this Access Token in Note section. b. Set an Expiry for this, personally I use a No expiration but its is usually recommended to go for a set number of days Eg: 30 days. c. I usually check mark everything, so that I have full access of my GitHub Account from the terminal.
- Click on Generate Token.
- This will generate a code, copy this code and store it in a very very very safe place (No not in a Notepad .txt file)
Windows: make sure to install git and make sure its added to the PATH.
- Open Terminal (Windows Terminal/ Bash/ Fish / Zsh Shell ).
- (Optional) Create a new Folder or Change directory to your desired location using
mkdir
is a short for "Make Directory" andcd
is a short for Change Directory
mkdir all_repos
# or
mkdir /path/to/all_repos (might not work in windows)
or
cd all_repos
# or
cd /path/to/all_repos
- Clone repo using:
git clone https://github.com/1412kauti/space_gripper.git
- This will prompt for a username, use your github username (NOT THE EMAIL) and press
Enter/Return
. - For the password, paste the Personal Access Token (PAT) from the previous step. (No Not your Github Password...it wont work)
- After cloning the project,
cd
into the cloned project:
cd space_gripper
- Get all the previous changes:
git pull
- leave the terminal(No Do'nt close it), Make a few changes to the project (IDK...add theory pdf/docx files or Matlab files,etc in their respective folders using Windows Explorer/ Mac Finder / Nautilus)
- now come back to the same Terminal and add the changed files for a commit using: (NOTE: Empty Folders are not added)
git add .
- Commit the changes along with a message using:
git commit -m "Message of the Day...LOL"
- Push changes using
git push