Journal

satya - 4/18/2018, 8:13:05 AM

After many fails, the path that worked


Create an empty repo  on Github (using web)

Use Eclipse Egit (I need to)

Clone using the URL

satya - 4/18/2018, 8:14:43 AM

Here is what happens with clone

A local repo is created

A remote called origin pointing to the server exists

A default branch called master is created to local

origin/master is linked to local/master

satya - 4/18/2018, 8:15:42 AM

Copy my java project

copy the code from my java project

Create .gitignore in the bin directoy

Use Commit and Push

satya - 4/18/2018, 8:18:02 AM

What is commit and push

This shows 3 things in egit

1. what files are new and need to be staged. These are listed

2. Allows to stage them (button clicks)

3. Once staged commit and push

4. Commit creates a commit point on local/master

5. Push knows that the local/master is tracked to origin/master and pushes that commit point and the code to origin/master on the server

satya - 4/18/2018, 8:18:59 AM

Then use eclipse to import the .prj file to create the java project out of the directory

This is a bit weird and I don't even know how i did this. But somehow stumbled to end up with a valid eclipse java project.

satya - 4/18/2018, 8:25:21 AM

What I understood

A repo is a collection of branches and commit points

A remote repo and its branches can be tied to the local branches by tracking them, although they don't have to be.

I understand local branches and remote branches

I understand checkout, fetch, merge, conflict, pull, push, and clone and how they effect branches

satya - 4/18/2018, 8:26:34 AM

An early work flow

A single contributor with a local and a remote

Make changes

Use Commit/Push to see changes, stage them, commit them, and push them to the default connected master branch on server from local branch

satya - 4/18/2018, 8:27:17 AM

Where do I see changed files in egit?

Only way I could do this is to see the "Commit/Push" dialog box.

satya - 4/18/2018, 8:28:19 AM

Where do I see all the commits and my branches in egit?

Where do I see all the commits and my branches in egit?

Search for: Where do I see all the commits and my branches in egit?

I could not find the equivalent of git log.

satya - 4/18/2018, 8:30:06 AM

How do I undo changes on a file to an earlier commit in egit?

You can see changed file in the commit dialog

right click on the changed file and you can roll back to a previous commit

satya - 4/18/2018, 8:34:51 AM

Looks like one can see the commits on a branch in the reflog view in egit

Looks like one can see the commits on a branch in the reflog view in egit

satya - 4/18/2018, 8:46:07 AM

In egit Commit/Push view is also called "Git Staging" view

In egit Commit/Push view is also called "Git Staging" view

satya - 10/24/2019, 11:51:50 AM

10/24/2019

10/24/2019

satya - 10/24/2019, 11:52:58 AM

A key question is how do I know the state of my local repo to the state of the remote repo??

More accurately, when I come back after an absence how do I analyze my current branch and the remote branch?

satya - 10/24/2019, 11:54:37 AM

GitGraph is a tool in vscode

1. It is nice

2. Stand alone and won't interfere with builtin git or gitlens

3. Shows each repo in the root folder of vscode

4. Shows the commit history of remote and local

5. One can look at the latest commit histories in local and remote and make judgments as to what is the change

satya - 10/24/2019, 11:56:59 AM

when you come after an absence

1. See if there are any files to be staged or committed? (vscode git view will tell you this)

2. See gitgraph history of local branch and remote branch

3. commit all the work if there is to be commited

4. Pull the work from server (Notice, this may result in conflicts which will need to be manually resolved and committed)

5. Push any pending commits

6. That will sync up both

satya - 10/24/2019, 11:59:12 AM

So far, 2 essential tools in vscode for Git

1. Vscode itself with builtin git (Also see the command palette git:...) in addition to the obvious menu items

2. GitLens (To show locals, remotes, and respective branches, and tags)

3. GitGraph (A great tool to see how branches differ or moving). A nice alternative to git log

satya - 10/24/2019, 12:01:15 PM

very important git commands

very important git commands

Search for: very important git commands

It appears a good set of command line tools are very helpful to get a quick sense of where the repos are. Hope to collect these and document in the next rev.

satya - 10/24/2019, 12:02:24 PM

Favorite git commands

Favorite git commands

Search for: Favorite git commands

satya - 10/24/2019, 12:02:36 PM

Most useful git commands

Most useful git commands

Search for: Most useful git commands

satya - 10/24/2019, 12:02:49 PM

Essential Git Commands

Essential Git Commands

Search for: Essential Git Commands

satya - 10/24/2019, 12:05:52 PM

Important initial git questions

1. What are my local branches

2. what are my remotes (also called refs)

3. what local branches are tied to what remote branches

4. is there pending work on my local branch

5. what are the last 5 commits on the remote and their dates

6. what are the last 5 commits on the local branch

7. Is there a discrepancy between the two?

8. How do I pull the latest, merge, and push back to the server

satya - 1/17/2020, 3:12:11 PM

Cloning using VSCode is documented here

Cloning using VSCode is documented here

satya - 2/27/2020, 11:11:59 AM

git command to stage, commit, and push

git command to stage, commit, and push

Search for: git command to stage, commit, and push